Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    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
    what can I do ?
    Matt Scheurich
    Hiya guys. I just wanted to ask a question regarding moment.startOf and moment.endOf in relation to locale and Middle Eastern countries. It seems there are a few (about 15 from my calculations) which start on a Saturday...
    I don't know how accurate this chart is, but it's currently the only source of info that I can find with some kind of tabular data connecting country names to start of the week: http://chartsbin.com/view/41671
    Matt Scheurich
    I also did some quick normalisation (in conjunction with a gist I found online of ISO 3166-1 alpha-2 country codes) and further processing of the data: https://codepen.io/lvl99/pen/qYWVmd
    Maybe there's some thing more complex here as it's more to do with a country than a locale, right?
    Or maybe there's some shared locale information, I'm not sure
    Matt Scheurich
    it's probably already in the code anyway
    Muhammad Sohail
    Angular Cannot find name 'moment'.
    Elvis Begović
    It seems moment isn’t tree sheakable lib
    All locales are in my bundle very annoying, any way avoid this? In ts project for browsers
    Mike Escalante
    I'm getting a custom string back from someone that i need format - it looks like "201608051348" which is "YYYYMMDDHHMM"... this is NOT an ISO format, and I can't seem to figure out how to parse this... is Moment going to work for that or should I just write something from scratch and parse it as a Date()
    moment('201206130139', 'YYYYMMDDHHmm') worked... i was using MM because i haven't had enough coffee
    Sharikov Vladislav


    What is correct way to use momentjs for DATE ONLY case? DATE ONLY = date without time ?

    For instance, for the CALENDAR component (without date). How to create momentjs object without time or how to detect momentjs object was initiated without time?

    Sharikov Vladislav
    Is is possible to get initial format if momentjs object was initiated with ISO string?
    Sharikov Vladislav
    moment('2024-12').endOf('month').add(-12, 'hours').format('W')
    Both of these result to 1. Why? It must be something like 52.
    Sharikov Vladislav
    I got it. Thank you.
    Hallvord R. M. Steen
    I'm seeing a very weird test failure that boils down to moment-timezone returning an unexpected date :(
    The test uses proxyquire to stub some APIs. This seems to be significant.
    and it seems significant that some of the server files used require('moment') while the test used require('moment-timezone')
    Code attempts to find next spring's DST change date for Oslo/Norway this way: moment().tz('Europe/Oslo').add(1, 'year').month(2).endOf('month') .weekday(0)
    Hallvord R. M. Steen
    now, this is very strange: if proxyquire runs before this code, and sets up a server with APIs that do require('moment'), the calculation above ends up with an unexpected date!?? March 25th 2019 (a Monday) rather than the expected 31st.