0

Expected date format is "DD-MM-YYYY" but shown date format as "YYYY-MM-DD" in UI.

Click here to show UI image

  1. Before opening the date picker, date is shown in the expected format as "DD-MM-YYYY".
  2. When the date picker is opened, the date format is changed in to "YYYY-MM-DD" format.
  3. After closing date picker, it came back to the previous state (expected format as "DD-MM-YYYY").

How to show same date format in all the three states mentioned above ?

1 Answers1

0

outputType is what you need, read the Wiki, if you want to change the date separator (-, /, .) then following this dateSeparator - Wiki

ghiscoding
  • 12,308
  • 6
  • 69
  • 112
  • There is only predefined date types in outputType. I need to use my custom date type like 'DD-MM-YYYY' => 28-02-2001(IST date format), DD/MMM/YY => 28/JAN/98 , YYYY/MM/DD => 2013/07/14 etc.... etc... – R S Moorthi Jul 26 '21 at 06:30
  • Any update on this? @ghiscoding – R S Moorthi Feb 22 '22 at 09:07
  • all those types are supported already, just change the `dateSeparator`, I updated the answer to demo that. Apart from that the lib probably won't work with custom `FieldType`, the formatting of the date happens in this util function [mapFlatpickrDateFormatWithFieldType](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/services/utilities.ts#L608) – ghiscoding Feb 22 '22 at 14:36