momen sudut
npm install --save moment
...
import * as moment from 'moment';
GutoTrosla
npm install --save moment
...
import * as moment from 'moment';
npm install --save moment ngx-moment
...
import { MomentModule } from 'ngx-moment';
@NgModule({
imports: [
MomentModule
]
})
npm install --save moment
import * as moment from 'moment';
...
let myMoment: moment.Moment = moment("someDate");
moment("20111031", "YYYYMMDD").fromNow(); // 9 years ago
moment("20120620", "YYYYMMDD").fromNow(); // 8 years ago
moment().startOf('day').fromNow(); // 13 hours ago
moment().endOf('day').fromNow(); // in 11 hours
moment().startOf('hour').fromNow(); // 4 minutes ago