Due date input uses user's local date format

Signed-off-by: Willian Gustavo Veiga <beberveiga@gmail.com>
This commit is contained in:
Willian Gustavo Veiga
2018-08-25 11:57:56 -03:00
parent b3b16f8fbd
commit f8239f4e8a
2 changed files with 5 additions and 3 deletions

View File

@@ -30,9 +30,10 @@ app.directive('datepicker', function () {
return {
link: function (scope, elm, attr) {
return elm.datepicker({
dateFormat: 'yy-mm-dd',
dateFormat: moment.localeData().longDateFormat('L').replace('YYYY', 'YY').toLowerCase(),
onSelect: function(date, inst) {
scope.setDuedate(moment(date));
var selectedDate = $(this).datepicker('getDate');
scope.setDuedate(moment(selectedDate));
scope.$apply();
},
beforeShow: function(input, inst) {