Date Masking With Calendar

The Calendar component supports a rich date masking syntax that allows you to format the visible dates in a variety of different ways.

Date Mask Attributes

The following HTML attributes can be set to configure date masking at various levels within the component.

<ntb:datepicker>

<ntb:dateinput>

  • displaymask: The mask applied to the <ntb:dateinput> text input element. Defaults to MMM dd yyyy.
  • editmask: The mask applied to the <ntb:dateinput> when the input is focussed. This can be used to make editing the input easier. Defaults to the value of the displaymask.

Mask Types

You can format the different parts of a date in a variety of ways, and then combine them together in any order you wish. For example, given the date Wednesday, January 30th, 2008, the various mask types would yield:

  • yyyy - 2008
  • yy - 08
  • M - 1
  • MM - 01
  • MMM - January
  • NNN - Jan
  • d - 30
  • dd - 30
  • EE - Wednesday
  • E - Wed
page_revision: 1, last_edited: 1224629615|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License