2016-06-23 09:47:54 -07: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 17:12:25 -07:00
|
|
|
import {Component} from '@angular/core';
|
2015-11-02 15:46:59 -08:00
|
|
|
|
|
|
|
// #docregion DatePipe
|
|
|
|
@Component({
|
2016-09-08 21:41:09 -07:00
|
|
|
selector: 'date-pipe',
|
2015-11-02 15:46:59 -08: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-08 21:41:09 -07:00
|
|
|
export class DatePipeComponent {
|
2015-11-02 15:46:59 -08:00
|
|
|
today: number = Date.now();
|
|
|
|
}
|
|
|
|
// #enddocregion
|