litepie-datepicker icon indicating copy to clipboard operation
litepie-datepicker copied to clipboard

Display format and get other format

Open nezamy-wow-ws opened this issue 3 years ago • 11 comments

Hello, How I can display date format in input and get another format as a value

nezamy-wow-ws avatar Mar 25 '21 10:03 nezamy-wow-ws

you can format manually before send value to server.

kenhyuwa avatar Mar 25 '21 10:03 kenhyuwa

Yes I can do that but I prefer to get the value from the component What I mean, I want to display the date format by example showing month name in Arabic and get other format in value

<LitepieDatepicker
      i18n="ar"
      :formatter="displayFormatter"
      :value-formatter="valueFormatter"
      :disable-date="disableDate"
      v-model="displayDate"
      v-model:value="valueDate"
/>

nezamy-wow-ws avatar Mar 25 '21 10:03 nezamy-wow-ws

Okay, I'm not sure if everyone needs this feature or not.

kenhyuwa avatar Mar 25 '21 10:03 kenhyuwa

It's surely missed. I want to display a nicely formatted date in input but send ISO formatted dates to API.

alesf avatar Mar 30 '21 18:03 alesf

you can format before send to API. but I not sure for adding this feature.

kenhyuwa avatar Apr 03 '21 07:04 kenhyuwa

Hi! This feature could be useful for me too! Thanks

lupanom avatar Jul 02 '21 09:07 lupanom

That'd be great for me too.

sentiasa avatar Jul 02 '21 13:07 sentiasa

@kenhyuwa Any ETA for that? Need any help? Not sure how I would approach this but I could probably help.

afunnydev avatar Aug 05 '21 22:08 afunnydev

@kenhyuwa I think this feature would be great. Any ETA?

muarachmann avatar Sep 24 '21 16:09 muarachmann

Commenting to politely add my voice to support this request. It would be great to be able to format both separately (the shown date and the date sent to the API).

bastihilger avatar Sep 29 '21 16:09 bastihilger

Voting up too, because it's not only a matter of normalizing before sending to server, but also denormalizing server data to populate daterange picker values.

People in Europe are used to the DD/MM/YYYY format, but we store dates as YYYY-MM-DD. So when I initialize a date value with [YYYY-MM-DD, YYYY-MM-DD] format, it yells because the formatter wants an DD/MM/YYYY format to pretty-print it to the user.

bpolaszek avatar Dec 13 '21 17:12 bpolaszek