react-datetime icon indicating copy to clipboard operation
react-datetime copied to clipboard

Allow function value for dateFormat and timeFormat

Open MilosRasic opened this issue 8 years ago • 1 comments

I'm Submitting a ...

[ ] Bug report
[x] Feature request
[ ] Support request

Expected Results

It would add to flexibility of the component if we could supply a function for dateFormat and timeFormat props to implement display formatting not supported by moment.

This function would take the selected value as argument and return a string to be displayed.

A real world example where a format not supported by moment would be needed is a custom week of year formatting used by my company which doesn't correspond to any supported standards or localizations.

Actual Results

Currently the component only takes a valid moment.js format string.

MilosRasic avatar Jun 20 '17 12:06 MilosRasic

I would also need a similar feature. I need to supply few different time formats. For example: timeFormat="HH.mm" timeFormat="h.mm"

So that the input accepts multiple different options if user types it wrong.

shnigi avatar Feb 04 '21 09:02 shnigi