geomoment-angular

An angular module for date formatting; wraps geomoment. For use with browserify.

npm install geomoment-angular
38 downloads in the last week
59 downloads in the last month

geomoment-angular

An angular.js module for date formatting with explicit timezones; wraps geomoment.

examples

setup:

angular.module('my-module', ['geomoment']);

service:

injectedFunction = ['geomoment', function(geomoment) {
  geomoment.day('2013-02-08');
}];

filters:

Filter exampleResult
{{'2013-02-08T09:30' | formatDate:tzid:'h:mm:ssa'}}9:30:00am
{{'2013-02-08' | formatDay:'weekday'}}Friday
{{'2013-02-08T09:30' | addTime:'days':1 | formatDay:'MMM Do YYYY'}}Feb 9th 2013
{{'2013-02-08T09:30' | subtractTime:'hours':9 | formatDate:tzid:'h:mma'}}12:30am

directive:

<form name='dateForm'>
  <input ngModel='date' geomoment='YYYY-MM-DD h:mm a' tzid='America/Los_Angeles'>
</form>

The geomoment directive will convert a string representation of a date (expressed in the geomoment attr) into a javascript Date object. It uses the geomoment library to parse input dates, so it does a pretty good job of interpolating human input.

npm loves you