angular-datetime

WebJar for angular-datetime

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

angular-datetime
Last Version

Last Version

3.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

angular-datetime
WebJar for angular-datetime
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/vokal/angular-datetime

Download angular-datetime

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : moment jar [2.10.6,3)
org.webjars.npm : moment-timezone jar [0.5.0,0.6)

Project Modules

There are no modules declared in this project.

angular-datetime

Basic date/time pickers for Angular.js.

Maintained by @Tathanen and @dmaloneycalu

Configuration & Usage

Both the date picker and the time picker require Moment as a dependency. Include moment.js prior to the following directive scripts.

Date Picker

Add dist/angular-date-picker.js and dist/angular-date-picker.css to your project, and include vokal.datePicker in your module dependencies.

<input type="text" data-ng-model="dateModel" data-date-picker[="M/D/YYYY"]
    [data-picker-type="date"]
    [data-timezone="tzModel"]>

date-picker

By default the picker displays using the M/D/YYYY Moment date format. You can supply a value to change this to any other supported format. If you format your date in a fashion that moment().format doesn't understand, you will have... problems.

picker-type

By default the picker will expect the model associated with the input field to be of date type, and selected values will be stored as dates. You can set this value to string instead to store the string value that appears in the input field in the model using the format provided in the date-picker attribute.

When the model type is date, the date picker will preserve any time of day already on the model. This allows this directive to work alongside the time picker on the same date model without interference.

timezone

The date picker has optional support for timezones, provided by moment-timezone. To use timezones, include moment-timezone.js and its necessary data after the moment.js script. If this attribute is included without moment-timezone, a warning will log and this attribute will be ignored.

Supported zones are limited to those identifiable to moment-timezone, which can be found by running moment.tz.names(). The attribute is watched and will update the input value on change. If the value is set to null or undefined, moment-timezone will attempt to guess the local timezone.

Time Picker

Add dist/angular-time-picker.js and dist/angular-time-picker.css to your project, and include vokal.timePicker in your module dependencies.

<input type="text" data-ng-model="timeModel" data-time-picker[="h:mm a"]
    [data-picker-type="date"]
    [data-picker-interval="60"]
    [data-timezone="tzModel"]>

time-picker

By default the picker displays using the h:mm a Moment time format. You can supply a value to change this to any other supported format. If you format your time in a fashion that moment().format doesn't understand, you will have, yes, problems.

picker-type

By default the picker will expect the model associated with the input field to be of date type, and selected values will be stored as dates. You can set this value to string instead to store the string value that appears in the input field in the model using the format provided in the time-picker attribute.

When the model type is date, the time picker will preserve the calendar date already on the model. This allows this directive to work alongside the date picker on the same date model without interference.

picker-interval

By default the picker will display times on a 60-minute interval. This can be changed to any value between 1 and 60 to include more granular times. Intervals do not wrap around the hour, so a value of 45 will produce a list of times like 2:00, 2:45, 3:00, rather than 2:00, 2:45, 3:30.

timezone

The time picker has optional support for timezones, provided by moment-timezone. To use timezones, include moment-timezone.js and its necessary data after the moment.js script. If this attribute is included without moment-timezone, a warning will log and this attribute will be ignored.

Supported zones are limited to those identifiable to moment-timezone, which can be found by running moment.tz.names(). The attribute is watched and will update the input value on change. If the value is set to null or undefined, moment-timezone will attempt to guess the local timezone.

org.webjars.npm

Vokal

The one-stop development shop for big brands, startups, & everything in between. We love what we do & we want to work with you.

Versions

Version
3.0.4