Change Date Format in Calendar Control Date field

I have a date field in my custom form that is not bound to any item type. The Calendar Control Time selection is disabled by default as the default format is Short date. How do i change this to long date so the time selection is enabled?

Parents Reply
  • Hello,

    This is possible by passing a format parameter into the Date dialog when you open it. You can see all of the available parameters for the different standard Aras dialogs in this blog post. Your updated code will look something like the sample below.

    var i18n = aras.IomInnovator.getI18NSessionContext()
    var format = i18n.GetUIDatePattern("long_date_time"); // M/d/yyyy h:mm:ss a
    var params =
    {
    // date: origDate, <-- You can use this to pass in a date you want the dialog to start at
    format: format,
    aras: top.aras,
    type: 'Date',
    title: 'Select Date',
    dialogWidth: 250,
    dialogHeight: 250
    };
    // Open the dialog and do all of your processing below

    Chris

    Christopher Gillis

    Aras Labs Software Engineer

Children