Skip to main content
Formatting output
Levi Kovacs avatar
Written by Levi Kovacs
Updated over 6 years ago

Sometimes a full date is not needed. Let’s take the credit card expiration date as an example where you'll be needing to set the wheels to month and year. Don’t forget to set the min and max for it to make sense.

TIP: Check out this demo with a working example.

Changing the date and time format

There are two approaches depending on the outcome you are after:

  • For having the wheels show the same format as the returned value use the dateWheels and timeWheels settings

  • If you need the value to be returned in a different format than the time wheels, use the dateFormat and timeFormat settings

JS

dateWheels: 'mm - MM  yy',
dateFormat: 'mm/yy'

12/24 hour time format

Configurations like 24 hour or 12 hour format with AM/PM comes from the timeFormat and timeWheels, which is a part of the localization settings, however it is ok to manually override it if you need to.

JS

timeFormat: 'HH:ii',
timeWheels: 'HHii'

What's next?

Did this answer your question?