I am using InputMask js (version 4.x) for date/datetime formatting.
I am trying to format a backend date which comes like this: 2018-03-23T00:00:00.000+01:00 and want to display it like this: yyyy.mm.dd
I tried to set the inputFormat attribute to 'yyyy.mm.dd' but it's not working. Instead, seems to work with mm.dd.yyyy, but I would like to display that backend date in different formats.
Here is the code:
(function($){
$('input').val(new Date('2018-03-23T00:00:00.000+01:00').toLocaleDateString());
$('input').inputmask("datetime",{
inputFormat: 'yyyy.mm.dd'
});
})(jQuery)
And a JSFiddle: https://jsfiddle.net/zq46eg90/8/
I would expect here to have '2018.03.23' displayed, but the actual result is something else (3232.01.08)