Code Monkey home page Code Monkey logo

Comments (4)

nobre84 avatar nobre84 commented on June 17, 2024

PS: I use code like this to generate the marks for appointments on a give month:
NSUInteger countDays = [aInitialDate differenceInDaysTo:aFinalDate];
//fill an array from 0 to countDays positions

It will give me the wrong count of days for the february month, whereas the old version would give me the right count

from tapkulibrary.

devinross avatar devinross commented on June 17, 2024

The delegate response is giving back Jan 30th 0:0:0 GMT and Mar 5th 0:0:0 GMT. The difference returned is actually 34 days b/c Mar 5th is not counted. Think about it instead of hours instead of days. If it were Jan 1 & Jan 2, the difference would only be 1 day (24 hours).

from tapkulibrary.

nobre84 avatar nobre84 commented on June 17, 2024

Hi, the difference returned between those days in my system is actually 33.
It probably has something to do with my timezone, which has daylight savings between October and February, the previous implementation seemed to handle it correctly

from tapkulibrary.

devinross avatar devinross commented on June 17, 2024

You might have to take the date object and set the timezone yourself b/c the current implementation calculates things by setting the timezone to GMT (to correct some issues).

from tapkulibrary.

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.