You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 29, 2019. It is now read-only.
When using weeks in the datepicker format there will be no change in the angular ngModel. (undefined). I debugged the code and found out that the dateParser can't parse a week 'ww'.
Currently i added my own week parser to the dateParser using the following
OLD
'ww': {
regex: '\\d{2}',
apply: function(week) {
// http://stackoverflow.com/a/16591175/1668675
var year = (new Date()).getFullYear();
if (typeof this.year !== 'undefined') {
year = this.year;
}
var simple = new Date(year, 0, 1 + (week - 1) * 7);
var dow = simple.getDay();
var ISOweekStart = simple;
if (dow <= 4) {
ISOweekStart.setDate(simple.getDate() - simple.getDay() + 1);
} else {
ISOweekStart.setDate(simple.getDate() + 8 - simple.getDay());
}
this.date = ISOweekStart.getMilliseconds();
}
}
When using weeks in the datepicker format there will be no change in the angular ngModel. (undefined). I debugged the code and found out that the dateParser can't parse a week 'ww'.
Currently i added my own week parser to the dateParser using the following
OLD
NEWEST
I used an solution already available on stackoverflow
http://stackoverflow.com/a/16591175/1668675
http://stackoverflow.com/questions/16590500/javascript-calculate-date-from-week-number
The text was updated successfully, but these errors were encountered: