#110

New

add moment examples

Reported by Volkan Ozcelik on JavaScript: from Zero to Hero · 14/07/2018 02:53:47

Assigned to:
Volkan Ozcelik
Priority:
Normal
Status:
New
Category:
Lessons
Version:
None

import * as moment from ‘moment’;

let today = moment().startOf(‘day’);
this.from = today.toDate();
this.fromToday = today.format(‘YYYY-MM-DD’);
this.daysOut = 1;
this.startMonday = moment().startOf(‘isoWeek’).format(‘YYYY-MM-DD’);
this.endSunday = moment().endOf(‘isoWeek’).format(‘YYYY-MM-DD’);
this.firstOfMonth = moment().startOf(‘month’).format(‘YYYY-MM-DD’);
this.lastOfMonth = moment().endOf(‘month’).format(‘YYYY-MM-DD’);

Attachments

No attachment has been uploaded, yet.


Loading comments...