I'm using the Calendar component to allow users to edit a date, and I set the format with the dateFormat attribute, like this:
Code: Select all
<Calendar dateFormat="dd/mm/yy" value={date} onChange={(e) => setDate(e.value)}></Calendar>
So my question is: is there a way to access the Calendar component's date formatting utility, in order to format a date from code?
Or, alternatively, is there a date formatting library that uses the same format strings that are used in the dateFormat attribute, so I can replicate the same behavior?