0

After calling Ext.Date.parse in JavaScript function, how to check whether the parsed date is valid?

var d = Ext.Date.parse(value, "c");
mhd
  • 446
  • 5
  • 18

1 Answers1

0
dt = Ext.Date.parse("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null

Parameters

input : String

The raw date string.
format : String

The expected date string format.
strict : Boolean (optional)

true to validate date strings while parsing (i.e. prevents JavaScript Date "rollover"). Invalid date strings will return null when parsed.

Defaults to: false

resource here

sakir
  • 3,391
  • 8
  • 34
  • 50