Skip to content
Snippets Groups Projects
Commit 0013b40a authored by Jared Hancock's avatar Jared Hancock
Browse files

js: Don't crash if no date set in a datepicker

parent 4a4543e3
No related branches found
No related tags found
No related merge requests found
......@@ -303,8 +303,9 @@ $(document).ready(function(){
$(document).on('submit', 'form', function() {
$('.dp', $(this)).each(function(i, e) {
var $e = $(e),
d = $e.datepicker('getDate'),
day = ('0'+d.getDate()).substr(-2),
d = $e.datepicker('getDate');
if (!d) return;
var day = ('0'+d.getDate()).substr(-2),
month = ('0'+(d.getMonth()+1)).substr(-2),
year = d.getFullYear();
$e.val(year+'-'+month+'-'+day);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment