Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Angular filters and factories for date formatting.
CoffeeScript

0.10.1

latest commit f12d4e8c88
@demands demands authored
Failed to load latest commit information.
lib
spec
src
.gitignore
LICENSE Adds license info.
README.md
geomoment-angular.js
geomoment-angular.min.js
package.json

README.md

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 example Result
{{'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.

License

The MIT License (MIT)

Copyright (c) 2014 Good Eggs Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.