issue with date type field

issue with date type field

javismilesjavismiles Posts: 205Questions: 38Answers: 3

datetime format field

if (obj.t=="datetime"){
fieldobj[index] = {
label: obj.d,
name: obj.i,
className: obj.c,
type: "datetime",
def: function () { return new Date(); },
format: 'YYYY-MM-DD HH:MM:SS',
fieldInfo: 'Euro style date with 24 hour clock'
};

2 issues, first, the calendar picker that appears, changing the hour updates the input field, but changing the minute does NOT update the input field, feels like a bug

second, how can I ensure that the def: def: function () { return new Date(); },
returns a date in a specific time zone? thank u very much

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    the calendar picker that appears, changing the hour updates the input field, but changing the minute does NOT update the input field, feels like a bug

    It appears to work okay in this example. Can you link to a page showing the issue please?

    second, how can I ensure that the def: def: function () { return new Date(); },
    returns a date in a specific time zone?

    new Date() will create a date object in the time zone the host browser is set to. If you want to create a UTC date object, use Date.UTC.

    Allan

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    Thank you Allan, this is now resolved, we can close it, thank you

This discussion has been closed.