Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

moment

moment().subtract(10, 'days').calendar(); // 08/21/2022
moment().subtract(6, 'days').calendar();  // Last Thursday at 2:24 PM
moment().subtract(3, 'days').calendar();  // Last Sunday at 2:24 PM
moment().subtract(1, 'days').calendar();  // Yesterday at 2:24 PM
moment().calendar();                      // Today at 2:24 PM
moment().add(1, 'days').calendar();       // Tomorrow at 2:24 PM
moment().add(3, 'days').calendar();       // Saturday at 2:24 PM
moment().add(10, 'days').calendar();      // 09/10/2022
Source by momentjs.com #
 
PREVIOUS NEXT
Tagged: #moment
ADD COMMENT
Topic
Name
2+1 =