MomentJS - Creation Data


Advertisements

This method allows to access the data, that is the input provided once the moment is created. It returns the object with the inputs.

Syntax

moment().creationData();

Observe the following example to understand the working of creationData in MomentJS −

Example

var m = moment("2013-01-02", "YYYY-MM-DD").creationData();
m.input;
m.format;

Output

Creation Data
momentjs_parsing_date_and_time.htm
Advertisements