angular-dateParser

WebJar for angular-dateParser

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-dateparser
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

angular-dateParser
WebJar for angular-dateParser
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dnasir/angular-dateParser

Download angular-dateparser

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-dateparser/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-dateparser</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-dateparser/
implementation 'org.webjars.bower:angular-dateparser:1.1.1'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-dateparser/
implementation ("org.webjars.bower:angular-dateparser:1.1.1")
'org.webjars.bower:angular-dateparser:jar:1.1.1'
<dependency org="org.webjars.bower" name="angular-dateparser" rev="1.1.1">
  <artifact name="angular-dateparser" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-dateparser', version='1.1.1')
)
libraryDependencies += "org.webjars.bower" % "angular-dateparser" % "1.1.1"
[org.webjars.bower/angular-dateparser "1.1.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower : angular jar [1.4.9,2)
org.webjars.bower : angular-i18n jar [1.4.9,2)

Project Modules

There are no modules declared in this project.

No longer maintained

Angular DateParser

A simple parser that converts date and time strings into JavaScript Date objects.

Demo

Prerequisites

  1. Angular 1.0.5+

Installing

bower install angular-dateParser --save

or

npm install angular-dateParser --save

Usage

Simply include the parser file, add it as a dependency and call it like so:

$dateParser(string, format)

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.

Expected return value is a JavaScript Date object, or undefined if values are invalid.

Date formats

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 w or ww format strings are used, the parser will return undefined in 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.

Localisation

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.

Versions

Version
1.1.1
1.0.12