Search.../

dateFormat

Sets or gets the format of the date displayed in the date picker.

Description

Setting dateFormat changes the way the date is displayed in the date picker.

Valid formats:

  • 'MM/DD/YYYY'
  • 'DD/MM/YYYY'
  • 'YYYY/MM/DD'
  • 'YYYY/M/D'

Getting the dateFormat property returns the current format used to display the date in the date picker.

dateFormat does not affect the format of the value property.

Type:

stringRead & Write, default value is 'MM/DD/YYYY'

Was this helpful?

Get a date picker's date format

Copy Code
1let format = $w('#myDatePicker').dateFormat; // 'MM/DD/YYYY'
Set a date picker's date format

Copy Code
1$w('#myDatePicker').value = 'YYYY/MM/DD';