Semantic-UI-Calendar icon indicating copy to clipboard operation
Semantic-UI-Calendar copied to clipboard

Changing the datetime

Open TELLO0815 opened this issue 7 years ago • 3 comments

How can i change to format yyyy-MM-ddThh:mm?

`ampm: false,
        monthFirst: false,
        formatter: {
            date: function (date, settings) {
                if (!date) return '';
                var day = date.getDate();
                var month = date.getMonth() + 1;
                var year = date.getFullYear();
                var hour = date.getHours();
                var minu = date.getMinutes();
                return year + '-' + month + '-' + day + 'T' + hour + ':' + minu;
            }
        },
        type: 'datetime',`

Output: 2017-12-19T13:15 13:15

So on the end is the time again...

TELLO0815 avatar Dec 17 '17 01:12 TELLO0815

Have the same issue here ! Seems the date is setting once the day is selected, and then resetting once hour is selected. It result displaying the hours two times ...

dbendaou avatar May 23 '18 15:05 dbendaou

Okkkkkkk, it's because you should use datetime instead of date in the formatter

So it should look to something like

        monthFirst: false,
        formatter: {
            datetime: function (date, settings) {
         etc....

dbendaou avatar May 23 '18 16:05 dbendaou

should be close then

dbendaou avatar May 23 '18 16:05 dbendaou