ng-date-utils

0.1.1 • Public • Published

ng-date-utils

AngularJS filter to show dates always in UTC

Usage

  • toUTC filter is wrapper around AngularJs date filter. It always show the date in UTC. This is nice to show things like birthday dates without being affected by browser timezones.

You can pass one optionnal parameter

  • customFormat: by default 'longDate'. To customize it see here

Example

npm add ng-date-utils
import { ngDateUtils } from "ng-date-utils";

angular.module("myApp", ngDateUtils.name).controller("controller", ($scope) => {
	$scope.birthday = "1984-03-11";
	// It can accepts Dates too or complete isodate strings
	$scope.birthday = new Date();
});
<p>Showing date { birthday | toUTC }</p>
// This will show March 11, 1984

/ng-date-utils/

    Package Sidebar

    Install

    npm i ng-date-utils

    Weekly Downloads

    1

    Version

    0.1.1

    License

    none

    Unpacked Size

    2.67 kB

    Total Files

    4

    Last publish

    Collaborators

    • sebaplaza