Skip to content

Commit

Permalink
add date picker for date fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vabarbosa committed May 17, 2017
1 parent 7f60aac commit 822f271
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ var initForm = function() {

submitForm('#' + $(this).attr('id'));
});

// pickadate
$('.datepicker').pickadate({
format: 'yyyy-mm-dd',
formatSubmit: 'yyyy-mm-dd'
});
};

var updatePage = function() {
Expand Down Expand Up @@ -348,8 +354,6 @@ $(document).ready(function(){

// render the page
updatePage();



});

4 changes: 2 additions & 2 deletions public/templates/attended.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ <h3>I Attended An Event</h3>
<div class="row">
<div class="col s12">
<label for="eventstart">Date Start</label>
<input id="eventstart" name="dtstart" type="date" value="{{dtstart}}" class="datepicker" />
<input id="eventstart" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="datepicker" />
</div>
</div>
<div class="row">
<div class="col s12">
<label for="eventend">Date End</label>
<input id="eventend" name="dtend" type="date" value="{{dtend}}" class="datepicker" />
<input id="eventend" name="dtend" type="date" placeholder="YYYY-MM-DD" value="{{dtend}}" class="datepicker" />
</div>
</div>
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion public/templates/blogged.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h3>I Published a Blog</h3>
<div class="row">
<div class="col s12">
<label for="blogdate">Date</label>
<input id="blogdate" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="validate" />
<input id="blogdate" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="validate datepicker" />
</div>
</div>
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion public/templates/expense.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h3>I Spent Money</h3>
<div class="row">
<div class="col s12">
<label for="blogdate">Date</label>
<input id="blogdate" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="validate" />
<input id="blogdate" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="validate datepicker" />
</div>
</div>
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion public/templates/pr.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3>I Spoke To The Press</h3>
<div class="row">
<div class="col s12">
<label for="blogdate">Date</label>
<input id="blogdate" name="dtstart" type="date" placeholder="{{dtstart}}" value="" class="" />
<input id="blogdate" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="datepicker" />
</div>
</div>
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion public/templates/presented.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3>I Presented At An Event</h3>
<div class="row">
<div class="col s12">
<label for="sessionstart">Date</label>
<input id="sessionstart" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="validate" />
<input id="sessionstart" name="dtstart" type="date" placeholder="YYYY-MM-DD" value="{{dtstart}}" class="validate datepicker" />
</div>
</div>
<div class="row">
Expand Down

0 comments on commit 822f271

Please sign in to comment.