momentjs Questions

4

Solved

I am trying to recover the date format according to the location. For example, if I use moment.locale('fr') retrieve "DD/MM/YYYY" or retrieve "YYYY/MM/DD" with moment.locale('en'). As you can see,...
Cornflower asked 16/4, 2018 at 7:51

4

Solved

I created a small program to select the date using bootstrap-datepicker and write it to MySQL. The catch is that this date must be local to Europe/Berlin regardless where the user is at the moment...
Michaelemichaelina asked 25/11, 2015 at 13:41

3

Solved

I have current time in milliseconds as - 1454521239279 How do I convert it to 03 FEB 2016 and time as 11:10 PM ?
Celina asked 3/2, 2016 at 17:42

12

Solved

Using Moment.js I would like to get all days in a month of specific year in an array. For example: January-2014: [ "01-wed", "02-thr", "03-fri", "04-sat" ] any suggestions? I looked through Mome...
Bristol asked 31/8, 2014 at 2:27

4

Solved

I'm using MomentJS and fullcalendar. I want to get the first Monday of a month. I tried the following code but it doesn't work. let date = new Date(year, month, 1) moment(date).isoWeekday(1)
Amparoampelopsis asked 30/8, 2017 at 7:41

4

Solved

I have a string that is stored in UTC time. I am trying to see if this time is after the current UTC time. I am using momentjs and the isAfter() method returns the incorrect value when there is onl...
Postpositive asked 4/6, 2015 at 19:22

3

Solved

I have created some registrationSchema export const registrationSchema = (translate) => Yup.object().shape({ //... other properties that are validated. // for example username username: Yup...
Halie asked 26/2, 2019 at 14:58

2

Solved

Is there a way of comparing 2 dates without time with momentJS? I've tried various formats, but can't seem to get it to work. I have it working fine with dateTime: var ExpiryDate = new Date("11/...
Garnet asked 3/11, 2014 at 11:11

3

Solved

After reading react-datepicker doc's I have tried changing my date picker language as the doc's instructions: Globally by calling moment.locale(lang) Picker-specific by providing the locale pr...
Quinnquinol asked 9/8, 2018 at 14:0

3

Solved

I am using KeyBoardDatePicker from material-ui-pickers with moment utils for a DatePicker. import React, { Fragment, useState } from "react"; import { MuiPickersUtilsProvider, KeyboardDatePicker...
Fecula asked 9/3, 2020 at 12:44

4

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-01").year(); // -700 (RIGHT) For some reaso...
Audacious asked 15/9, 2014 at 10:38

3

Solved

Im upgrading a private angular library/package (my-lib) so i can migrate all other projects, but when imported into a project one of the services uses moment and throws an error: "ERROR TypeEr...
Incensory asked 8/2, 2022 at 17:37

22

Solved

How to get the difference between 2 times? Example: var now = "04/09/2013 15:00:00"; var then = "04/09/2013 14:20:30"; //expected result: "00:39:30" I tried: var now...
Centaur asked 4/9, 2013 at 21:6

3

Solved

I am trying to add a DateTimePicker using Tempus Dominus Bootstrap4. But I am getting the following error. I use Laravel as a front-end. So I use laravel-mix. my blade file is below @extends('l...
Pender asked 30/3, 2018 at 19:28

2

Solved

I have the util function that is parsing given date (i.e. '2019-01-28') in specific date format and then using momentJS retrieving beginning of that day and converting it to ISO date format: dates...
Isaiasisak asked 23/5, 2019 at 11:43

13

Solved

I'm trying to calculate a person's age using Moment.js, but I'm finding that the otherwise useful fromNow method rounds up the years. For instance, if today is 12/27/2012 and the person's birth dat...
Mallissa asked 27/12, 2012 at 16:0

3

So, I am using an Angular material datepicker which only helps me select a month and a year. https://material.angular.io/components/datepicker/overview#watching-the-views-for-changes-on-selected-ye...
Occupant asked 17/4, 2019 at 18:8

5

Solved

I am not able to get the JavaScript Date string for MongoDB record via the following. It keeps using my local time. var utc = moment.utc().valueOf(); console.log(moment.utc(utc).toDate()); Outpu...
Timbered asked 11/11, 2014 at 19:45

3

Solved

I have a requirement to convert date time in moment.js. But it gives me different result in Chrome and Firefox. In Google Chrome it gives correct result but in Mozilla firefox gives "Invalid date...
Medievalism asked 31/12, 2015 at 4:52

5

Solved

I'm trying to set the timezone for a date in moment.js without changing the time value I get a date in utc: date.toString() // Sun Sep 27 2015 00:00:00 GMT+0000 and I need to set the time zone wit...
Cloven asked 29/10, 2015 at 18:46

5

Solved

I need to add the variable secondsToMinutes to the startdate. secondsToMinutes is "3:20" startDate = "2:00 PM" endDate should equal "2:03:20 PM". I've tried a number of ways and get errors each a...
Theresiatheresina asked 3/2, 2017 at 19:45

4

Solved

I am using Moment.js to parse a string and get the day, month and year separately: var date = moment("12-25-1995", "MM-DD-YYYY"); var day = date.day(); However, day is not 25—it's 1. What is t...
Mesentery asked 2/2, 2015 at 17:31

4

Solved

I have a problem migrating to moment on Vuejs. After running npm install vue-moment and adding to my script: <script> const moment = require('vue-moment'); ... </script> I added ...
Flyer asked 11/10, 2019 at 13:16

5

Solved

I don't see this in the documentation of moment.js. Maybe I'm skipping over it but I want to convert a week number in a year to a date format. for example week: number = 13 year: number = 2017 ...
Hornblende asked 17/3, 2017 at 14:51

10

Solved

I have a output resulting from a timepicker giving 12 hour format of time. Eg : "1:45 AM (or) "12:15 PM" as **string** Is there a way to parse this string format to 24 hour using moment js back ...
Leavis asked 6/11, 2014 at 15:25

© 2022 - 2024 — McMap. All rights reserved.