GithubHelp home page GithubHelp logo

Comments (6)

jhoobergs avatar jhoobergs commented on July 17, 2024

Do you see any issues when using the library ? This method is used internally and might actually need it to return 242.

from android-week-view.

eranf91 avatar eranf91 commented on July 17, 2024

Yes, I had a bug therefore I digged in and got to the method.
In order to produce this case naturally:
The date of the device should be 08/09/2017(GMT +3), Then use method WeekView.goToDate('01/01/2017') (GMT +2) - This is actually a test case that we have.

The weekview should go to a day prior to the given date.

from android-week-view.

jhoobergs avatar jhoobergs commented on July 17, 2024

Ok, can you create a PR for this and use your own test to check if it is fixed ? We currently don't have a testing framework, any suggestions ?

from android-week-view.

jhoobergs avatar jhoobergs commented on July 17, 2024

@eranf91 Do you mean 01/09/2017 GMT+3 instead of 08/09/2017 GMT+3 ?

from android-week-view.

eranf91 avatar eranf91 commented on July 17, 2024
  1. I will open a pull a request
  2. I think you should consider start work with joda time, it is a simply better library then joda time (and as far for java 8 it is come with it)
  3. Thats means that you should start by adding a gradle depedency to joda time (since android is not running on JDK8)
  4. I Think that the coorect method: WorkWeekUtils.daysBetween should be:
    Days.daysBetween(new DateTime(dateOne), new DateTime(dateTwo)).getDays();
  5. I think it is required to write jUnits for this method since that there are to many cases to test
  6. I did not mean instead, I ment that for these to values the method return invalid value

from android-week-view.

jhoobergs avatar jhoobergs commented on July 17, 2024

I changed it to

return (int) (((dateTwo.getTimeInMillis() + dateTwo.getTimeZone().getOffset(dateTwo.getTimeInMillis())) / (1000 * 60 * 60 * 24)) - 
                ((dateOne.getTimeInMillis() + dateOne.getTimeZone().getOffset(dateOne.getTimeInMillis())) / (1000 * 60 * 60 * 24))); 
    } 

for now.

The unit tests would indeed be quite helpfull.

from android-week-view.

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.