Category "momentjs"

How to set start day time to particular time in momentjs

I'm trying to set the start time of the day to a particular time. currently, in momentjs, I can get startOf day like this let now = moment() console.log('now'

moment.calendar shows today as the day instead of 5 days ago

I am using moment version 2.24.0 (I did have an older version but updated to see if it fixed this problem, which it didn't), in Angular application. I have the

How to diff two HH:mm:ss formatting in moment

moment(moment("00:00:00", "HH:mm:ss").diff(moment("18:00:00", "HH:mm:ss"))).format("HH:mm:ss"); moment(moment("00:00:00", "HH:mm:ss").diff(moment("18:00:00", "H

Bootstrap datetimepicker not working inside Bootstrap Modal

I am facing issue in showing bootstrap's datetimepicker inside modal. I want to make form inside the modal on which I need a datetimepicker to pick date and tim

How can I use moment.js to add days, excluding weekends?

I'm setting a default follow-up date two days from current date, which currently works: const Notify = moment().add(2, 'days').toDate(); However, I would lik

Mocking moment() and moment().format using jest

I'm unable to mock moment() or moment().format functions. I have states where, currentDateMoment and currentDateFormatted are getting set as below. currentDateM

Mocking moment() and moment().format using jest

I'm unable to mock moment() or moment().format functions. I have states where, currentDateMoment and currentDateFormatted are getting set as below. currentDateM

Moment.js startOf is returning end of day

I am passing in the following date through query string: 2020-09-23 I am trying to figure out why the below code with the doesn't work comment above it is not w

From date to day start time and end time in utc in specific timezone using moment

Hi I am trying to find specific date to timezone, based on day start and end time in UTC, using momentJS. For example: I have one date : 2020-08-17 and its tim

Ion-datetime min/max for hours doesn’t works

I'm trying to implement a min and max attributes for datepickers. So i have two datepickers, one for start and another for the end, both just pick hours and min

Javascript moment Is within a date range api

Currently using http://momentjs.com/ Is there a function I can use as below to find out if array of dates fall within a single day? Example: Events0 - 21-12-

How to format BC dates (like "-700-01-01")?

How to format ISO dates BC with Moment.js? moment("-700-01-01").year(); // 700 (WRONG) moment("-0700-01-01").year(); // 700 (WRONG) moment("-000700-01-0

Moment.js - how to get user time zone?

I want to set current time zone with moment.js for user that runs my app. My problem is that many of momentjs question posted here have method called tz but I c

compare dates using momentjs

I have a date timestamp stored in mysql which is like 2017-06-29 08:37:31 I am getting it through AJAX and I want to compare it with current date, whether it i