IvyTools

General Category => General Discussion => Topic started by: Antony on April 12, 2018, 09:24:18 AM

Title: Date/time format
Post by: Antony on April 12, 2018, 09:24:18 AM
Dear Ivy team,
Is there a way to specify date/time format for "toDate()" function? It doesn't seem to work for dates in did/mm/yyyy format, only mm/dd/yyyy.

Thanks,
Antony G.
Title: Re: Date/time format
Post by: admin on April 13, 2018, 03:25:21 PM
Hi Antony,

It can be done in the latest release:

Code: [Select]
IvyOptions.ToDateFormatMonthFirst = true;
If you are using IvyTemplateEditor it can be set on the template level (Template Settings / Template Custom Code):

Code: [Select]
protected override void Init()
{
    IvyOptions.TableCellType = TableCellType.String;
    IvyOptions.ToNumberCultureInfo = new CultureInfo("fr-FR");
    IvyOptions.ToDateFormatMonthFirst = true;
}

Regards,
Ivy Team