Open couderA opened 7 years ago
Hi, is a problem with the filter "mFormat" and the createMoment function. I solved with this.
Module.filter('mFormat', function () {
return function (m, format, tz) {
if (!(moment.isMoment(m))) {
if (m) {
return m;
} else {
return '';
}
}
return tz ? moment.tz(m, tz).format(format) : m.format(format);
};
});
createMoment: function (m) {
if (tz) {
return moment.tz(m, tz);
} else {
if (/\d\d\/\d\d\/\d\d\d\d/.test(m)) // Test with my format
return moment(m, 'DD/MM/YYYY');
else
return moment.isMoment(m) ? moment.unix(m.unix()) : moment();
}
}
I cannot update the selected date of my datepicker directly in JS.
And I would like to have my input empty rather than having the default set to today.