Angular Core Dependency: ^1.4.9
Module License: MIT
Added by: Sam Deering
bower install angular-dateParser --save
npm install angular-dateParser --save
Simply include the parser file, add it as a dependency and call it like so:
The first parameter is the date and time string you wish to convert to a Date object, and the second parameter is the format you're using. The format is optional, so if you're using the RFC2822 or ISO 8601 date formats, you're more or less safe, as the parser will simply pass the string to the Date constructor.
All Date formats specified in the Date filter documentation can be used, as well as custom formats. See the demo for examples.
Note: When the
wwformat strings are used, the parser will return
undefinedin the event the provided week number is invalid, or does not match the provided date string. It will return a valid Date object if the provided date falls within the start and end of the week for the provided week number.
This parser depends on the $locale service to provide it with the list of formats, as well as names of months and days. To use this feature, include the locale file included in the Angular bundle.
Module stats last updated: 2017-02-23 16:00:05