@richardpickett/my-momentjs
v0.0.10
Published
A config class for nodejs
Downloads
72
Readme
My momentjs
npm i @richardpickett/my-momentjs
var m = newMyMoment();
// 2023-07-17 12:12:15
console.log(m.FT());
// 2023-07-17T17:12:15.749Z
console.log(m.ISO());
// 2023-07-17T12:12:15-05:00
console.log(m.momentISOLocalTimeZone());
// Mon Jul 17 2023 12:12:15 GMT-0500
console.log(m.toString());
// same as toString
// Mon Jul 17 2023 12:12:15 GMT-0500
console.log(`${m}`);
var d = new Date();
// Mon Jul 17 2023 12:12:15 GMT-0500 (Central Daylight Time)
console.log(`${d}`);
momentjs Extensions
All the same functions of momentjs are available, here are some common ones:
moment().subtract(10, "days").calendar(); // 07/27/2023
moment().subtract(6, "days").calendar(); // Last Monday at 12:57 PM
moment().subtract(3, "days").calendar(); // Last Thursday at 12:57 PM
moment().subtract(1, "days").calendar(); // Yesterday at 12:57 PM
moment().calendar(); // Today at 12:57 PM
moment().add(1, "days").calendar(); // Tomorrow at 12:57 PM
moment().add(3, "days").calendar(); // Wednesday at 12:57 PM
moment().add(10, "days").calendar(); // 08/16/2023
moment().subtract(1, "day").isBefore(moment()); // true