Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    changed value is a String for a DateItem with a format

    SmartClient Version: v13.0p_2024-02-10/AllModules Development Only (built 2024-02-10)
    and also:
    SmartClient Version: SNAPSHOT_v13.1d_2024-02-13/AllModules Development Only (built 2024-02-13)

    Chrome on MacOS

    Hello, please try this test case:

    Code:
    isc.DynamicForm.create({
        ID: "aForm",
        fields: [
            {
                name: "aDate", useTextField: true, type: "date", format: "dd/MM/yyyy",
                change: function (form, item, value) {
                    isc.logEcho(value, isc.isA.String(value) ? "string" : "date");
                }
            }
        ]
    });
    When choosing a date with the DateChooser, you'll see that the value logged in the change handler is a String. Without the format, it's actually a Date.
    Is it expected, or is it a bug?

    #2
    It looks like there is a bug here and we'll investigate it on our end.
    A quick solution to this problem would be to remove the format: "dd/MM/yyyy" in favor of dateFormatter:"toEuropeanShortDate"
    (See docs here for DateItem.dateFormatter: https://smartclient.com/smartclient-....dateFormatter)

    In the meantime we'll also look at why specifying the format in this way is causing problems

    Regards
    Isomorphic Software

    Comment

    Working...
    X