2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-09-27 20:12:25 -04:00
|
|
|
import {Component} from '@angular/core';
|
2015-11-02 18:46:59 -05:00
|
|
|
|
|
|
|
// #docregion DatePipe
|
|
|
|
@Component({
|
2016-09-09 00:41:09 -04:00
|
|
|
selector: 'date-pipe',
|
2015-11-02 18:46:59 -05:00
|
|
|
template: `<div>
|
|
|
|
<p>Today is {{today | date}}</p>
|
|
|
|
<p>Or if you prefer, {{today | date:'fullDate'}}</p>
|
|
|
|
<p>The time is {{today | date:'jmZ'}}</p>
|
|
|
|
</div>`
|
|
|
|
})
|
2016-09-09 00:41:09 -04:00
|
|
|
export class DatePipeComponent {
|
2015-11-02 18:46:59 -05:00
|
|
|
today: number = Date.now();
|
|
|
|
}
|
|
|
|
// #enddocregion
|