Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Joe Early
    Changes my searchDate to Jan 18 for some reason
    Hi, all! What's being used for testing moment.js?
    I know it was Jasmine a while ago...
    Tomáš Krmela
    hello there i have question i have gatesbyjs project and i am call moment with this moment(new Date(date)).locale("cs").format("YYYY-MM-DD") when i am try it on local instance all is right displayed when i am deploy it out it use english locale
    Hua Lu
    Hello all, how can i tell some date is valid or not under certain locale with momentjs?
    Jon New
    Is there a way to detect if a given timezone is valid with moment? I see it logs an error when it doesn't recognize, but is there anything I can use programmatically?
    I am getting the time in seconds as a response from the server. How can I convert it to the format of YYYY-MM-DD using momentjs?
    in the frontend
    John Woodruff
    Is there a way to nicely attempt to parse a string into a date? Essentially I’m writing a way to infer a schema on a CSV, (in other words, I don’t know my data before I get it, so I can’t simply assume a format) so I attempt to parse the string value into a date. I thought I could use moment(‘some string’).isValid() but that still throws a deprecation warning stack trace. Is there some way/function I could use to simply test if a string is parseable to a date with moment?
    Hi, what happened to Duration Format Plugin, Uncaught TypeError: moment.duration(...).format is not a function at <anonymous>:1:33 ? (v2.2.1)
    Joe Early
    var backDteValue = moment().day() - 1;
     var lastSaturday = moment().day(- backDteValue);
     lastSaturday = moment(lastSaturday).format("MMMM Mo");
    Anything wrong with my format code? Before it take affect, the date is 10th Feb, after formatting its 2nd feb?
    Joe Early
    sorted it
    Stewart Rand
    Something seems to be wrong with the Typescript typing for moment
    Specifically, moment.localeData() is supposed to return a Locale, according to moment.d.ts
    however, there is a problem with the Locale definition, since none of its properties are prefixed with "_", which is how they really are, due to set() in moment.js
    I'm going to submit a PR for it, unless someone disagrees
    I'm basically going to be prefixing the properties of the Locale definition with an underscore, "_"
    Stewart Rand
    never mind, I'm a moron
    those properties definitely do exist, though
    I have requirement.
    Given Date is: 2018-02-14 (‘YYYY-MM-DD’)
    And I want output in 3 formats which should be localized.
    1) FEB 14 (‘MMM DD’)
    2) FEB 2018 (‘MMM YYYY’)
    3) 14 (‘DD’)
    4) FEB (‘MMM’)
    Can anyone help?
    @mj1856 hi Matt, I try to use moment with millis and I get the depreciation warning. Is it normal for millis as well?
    The issue is this: moment/moment#1407
    Kevin Engle
    Is there a way to alter units on humanize()? For example on moment.duration(2, 'weeks').humanize() I have 14 days returned when I'd rather have it humanized as 2 weeks.
    The documentation isn't really clear, the third example seems to imply 14 days should automatically be humanized as 2 weeks.
    Eder Gomez
    hi guys, can you use momentsJs in Java, if possible, how would you implement it?
    Alex Mitchell
    Could somebody provide comments on my bugfix pull request? I've never contributed to moment before and I want to make sure I'm following the correct convention and procedure. moment/moment#4410
    Hi guys, an issue . I have the same web-app (Django / Backbone /JQuery etc) deployed on two different servers behaving differently - one install reports an error in Moment.js , the other one runs fine (multiple installs). The big diff, with the 'error install' is its on a Linux box that I setup. I wonder if locale issues could cause Moment.js to throw an error?
    Its the same version of code running differently. Additionally, the 'error install' doesn't have an internet connection - runs completely isolated in a private network - when doing this moment.js has an issue. I am using v 2.1.0 of moment (yeah, its oold).
    James Addison
    How can I display 9:30 as 9:30 but 9:00 as just 9?
    Eder Gomez
    @jaddison Being time there is no reason to be to show only the time without the minutes.
    If you wish, you would have to compare the time and format moment().format("HH/hh") (HH for 24hrs. / hh for 12hrs.)
    Hi all
    Henry Dyer
    Good afternoon, all. Hoping someone could provide some advice on how moment works, and whether or not it could be applied in a certain manner.
    In particular, could Moment's manipulate function be used to change the timestamps shown to readers in <time> tags which have had the normal metadata stripped out on a wordpress install
    Or is it more likely that the changing timestamps (which can be different at the same time to different readers on varying devices) are being fiddled with elsewhere
    Because part of their wordpress theme & scripts is Moment.js
    Mohamed eliyas
    Hi guys,
    I am working on issue #4507
    I try to debug the code i found the issue. Actually the isSame() method in compare module only checks for local date format. Utc is defaultly set to false.
    I can able to fix this issue by using createLocalOrUTC method instead of createLocal.
    #4495 what is the status of this one? Typescript is giving errors that hTML5_FMT is not typeof moment when trying to use the const. as a special format.
    Hi everyone! I wanted to attempt to tackle adding the feature suggested in #4514 and wanted to see if anyone had any advice as to where I should look to attempt to contribute :) This would be my first contribution to moment
    Kodie Grantham

    Hi there! I am the creator of the moment plugin "moment-weekdaysin" (https://github.com/kodie/moment-weekdaysin) and back in July I tried to submit it to the moment website however @maggiepint had a few concerns and denied the request suggesting that I get on here to get some advice. moment/momentjs.com#439

    So I was just wondering what you guys recommend I change in my plugin. Thank you!

    Hi everyone!
    'DD/MM/YYYY \n H:mm' format outputs 09/04/2018 12:24,
    how can i get a line break between the date and the time?

    Hey guys
    I have a weird issue
    I have a string ISO date, lets call it startTime
    I also have a duration string, in the format of 'HH:mm:ss'
    I need to calculate the endTime as startTime + duration

    I am trying to do this like this:
    const endTime = moment(startTime).add(moment.duration(duration))

    but I keep getting the startTime unchanged as a result
    Mark Carpenter Jr
    Try establishing the duration object first and then use it inside the add function.
    Allan Ebdrup
    Hi. Moment is awesome, thanks for all your work!
    Regarding the deprecation warning: https://stackoverflow.com/questions/23263380/deprecation-warning-moment-construction-falls-back-to-js-date?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
    I am intentionally feeding moment an invalid string 'NotValid' in my tests to make sure it doesn't work. This outputs the deprecation warning and messes up my test output. Is there any way to suppress the deprecation warning when running tests?
    Oh finally found it: moment.suppressDeprecationWarnings = true; right?
    @mcarpenterjr thanks, that helped me :D
    Murat Aksoy
    Hi guys, I'm having a problem using utc and toDate functions.
    I try to get UTC date time as javascript Date object so I use :
    moment.utc().toDate() it returns my local time but if I use moment.utc().format("YYYY-MM-DD HH:mm"); then I get the UTC date time but just a string