@richardpickett/my-momentjs
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @richardpickett/my-momentjs

Weekly Downloads

2

Version

0.0.10

License

MIT

Unpacked Size

9.45 kB

Total Files

9

Last publish

Collaborators

  • richard.pickett