Giter VIP home page Giter VIP logo

Comments (5)

bholbrook73 avatar bholbrook73 commented on July 17, 2024

This is likely a timezone issue. I'm betting that moment.utc("01/01/2014").recur().... will do what you need. You can also do moment.recur("01/01/2014").... which sets the start date.

from moment-recur.

DDSmileyIII avatar DDSmileyIII commented on July 17, 2024

@bholbrook73 Both suggestions yield the same result as I reported in the original post.

from moment-recur.

c-trimm avatar c-trimm commented on July 17, 2024

Seems to work as expected here: https://jsfiddle.net/gg9gtm0c/
If you are still around and have any more information regarding the issue (actual source code would help), please let me know. Thanks.

from moment-recur.

garaboncias avatar garaboncias commented on July 17, 2024

As bholbrook73 suggested this is locale issue, but this is a bug in moment-recur
because moment-recur use moment.dateOnly() which is not documented (deprecated?) and not locale aware
I suggest lib should use moment.startOf('day')

moment("01/02/2017","MM/DD/YYYY").utcOffset(120,true).toString()
"Mon Jan 02 2017 00:00:00 GMT+0200"
moment("01/02/2017","MM/DD/YYYY").utcOffset(120,true).recur().every(1).daysOfWeek().next(1)[0].toString()
"Mon Jan 02 2017 22:00:00 GMT+0000"
moment("01/02/2017","MM/DD/YYYY").utcOffset(0,true).toString()
"Mon Jan 02 2017 00:00:00 GMT+0000"
moment("01/02/2017","MM/DD/YYYY").utcOffset(0,true).recur().every(1).daysOfWeek().next(1)[0].toString()
"Mon Jan 09 2017 00:00:00 GMT+0000"

from moment-recur.

YaoHuiJi avatar YaoHuiJi commented on July 17, 2024

It should be nice to add a note to document to tell users that moment-recur will return moment objects in UTC mode.

from moment-recur.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.