Date and time input issue

Date and time input issue

VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

See https://datatbl.herokuapp.com/dt

I don't understand what I do wrong ... datetime control doesn't recognize my format and shows current datetime instead of field's value(

I use the following settings:

type:  'datetime',
def:   function () { return new Date(); },
format: 'DD-MM-YYYY hh:mm'

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    If you have a look at the debug console in your browser it states:

    Uncaught Editor datetime: Without momentjs only the format 'YYYY-MM-DD' can be used

    You just need to load Moment.js and it should start working.

    Allan

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

    Oops! I forgot to include moment.js)

    Most rows are recognized as expected, but there is some exclusions, for example row id = 2, 7 or 8

    BTW: If you press Esc when the editing window is open, the editing window will close itself and the datetime picker remains open.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    format: 'DD-MM-YYYY hh:mm',

    I think you want:

    format: 'DD-MM-YYYY HH:mm',
    

    Thanks for noting the esc error. I'll have that fixed in 1.5.4.

    Allan

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

    Thank you Allan, it worked!

This discussion has been closed.