Category "momentjs"

How to check if time overlaps in javascript

Hi i am working on Reactjs Application where user needs to select four time slots .Like slot1 starting time, slot2 starting time ,slot1 ending time ,slot2 endi

How to select record in the database using BETWEEN in sql?

How to select record in the database using BETWEEN in sql? what I want here is to select record within the startDate and endDate. if the record is exists within

Why i get added 5 hours instead 4 on daylight saving time when i use the add method and how can i resolve it?

I need to add 4 hours to my moment js date. So for that i am using /* this timestamp is this date 27-03-2045 00:00 */ const someday = moment(2374178400000); con

Checking if the entered date is the start of a quarter

Good afternoon! Can you please tell me how to implement a function that checks if the passed date is the beginning of the quarter? I tried to implement validati

How do I change the language of moment.js?

I am trying to change the language of the date which is being set by moment.js. The default one is English, but I want to set the German language. These is what

Find nth week recurrence on week days with moment js

I have just started moment js, I'm trying to generate recurrence for every nth week for defined week days I have tried this code so far but not getting True for

how to properly get day of the week (name) with moment.js?

Im using https://openweathermap.org/ api. It provides timezone in seconds. How to properly get day of the week (name) using moment.js? const timezoneInMinutes

Moment.js isAfter() is not a function

I'm using FullCalendar with jQuery timepicker to set the event. I have 2 variables named timeDateInizio and timeDateFine. Those two variables are string created

React Native Community DateTimePicker value.getTime is undefined

Hey guys I have few questions regarding the community version of the RN DateTimePicker (https://github.com/react-native-datetimepicker/datetimepicker#value-requ

How to use dayjs relative time

Hi guys I have this weird problem when using Dayjs relative time Previously I use momentjs var date = "2021-02-26 16:04:15"; moment(date).fromNow(); The relati

How to use moment in nestjs application

I want to use momentjs in a nestjs app, and also be able to test my services. So I provided momentjs as below in my module providers: [ { provide: '

AngularJs form validation not working with ng-show

I am struggling with ng-show and $invalid logic, my requirement is very simple I need to make a form that will show input fields based on conditions. I need to

How can I format the Angular Material datepicker without moment.js dependency

What do I want to achieve? I want my Angular Material(v11) datepicker to use the DD-MM-YYYY format in an Angular version 11 project. What have I tried? I tried

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