Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the datetime #112

Open
TELLO0815 opened this issue Dec 17, 2017 · 3 comments
Open

Changing the datetime #112

TELLO0815 opened this issue Dec 17, 2017 · 3 comments

Comments

@TELLO0815
Copy link

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...

@dbendaou
Copy link

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
Copy link

dbendaou commented May 23, 2018

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
Copy link

should be close then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants