DayPilot.Date.parse

Declaration

DayPilot.Date.parse(input, pattern[, locale]);

Note that this is a "static" method. It needs to be invoked using the full prefix.

It can't be invoked on a DayPilot.Date instance.

Parameters

  • input (string) - the string to be parsed
  • patter (string) - the date format pattern
  • locale (string or DayPilot.Locale object) - the locale used for parsing (especially the full month names), Locale.US is used if not specified

Pattern Syntax

  • yyyy - full year
  • yy - shortened year
  • mm - minutes (two digits)
  • m - minutes (one or two digits)
  • d - day numer (one or two digits)
  • dd - day number (two digits)
  • ddd - shortened day of week name
  • dddd - full day of week name
  • HH - hours (two digits, 24-hour clock)
  • H - hours (one or two digits, 24-hour clock)
  • ss - seconds (two digits)
  • s - seconds (one or two digits)
  • MMMM - full month name
  • MMM - shortened month name
  • MM - month number (two digits)
  • M - month number (one or two digits)

Return Value

DayPilot.Date object if the parsing was successful, otherwise null.

Example

var date = DayPilot.Date.parse("12/31/2016", "M/d/yyyy");