Skip to content

Instantly share code, notes, and snippets.

@brandonhuff
brandonhuff / unicodetodate.pipe.ts
Created January 3, 2016 23:08
Angular 2 Beta.0 pipe for converting ISO 8601 string dates to javascript Date type.
// https://en.wikipedia.org/wiki/ISO_8601
// Example
// Usage: {{ dateValue | unicodeToDate | date:'MM/dd/yyyy' }}
// Data: 2014-01-05T18:14:18.32
// Result: 01/05/2014
import {Pipe} from 'angular2/core';
@Pipe({name: 'unicodeToDate'})
export class UnicodeToDatePipe {