Closed kamalessence closed 5 years ago
Thank you for the issue @kamalessence.
I wasn't able to reproduce the error quite, well.
Would you be able to provide me with a working demo by chance? (And compare with the demo I created - https://codesandbox.io/s/invalid-iso-for-date-1-in-getmatrix-67-g1r0e)
Hi @dance2die, your demo is also not working at my end. I am checking this in IST timezone. I think this might be due to variation in timezone.
I was able to reproduce when changing my machine to use IST timezone
Can you guys provide a fix or any workaround for this issue?
Thank you, @kamalessence & @ewolfe for reproducing the error. Let me research how the issue needs to be dealt with.
Hi @kamalessence
I've released v2.6.0, which fixes the issue.
Below is the screenshot with IST as timezone
https://codesandbox.io/s/invalid-iso-for-date-1-in-getmatrix-67-g1r0e
@dance2die, Thanks to provide quick response with a fix. Really Appreciated, Thanks a lot!
@kamalessence You're welcome & thank you for taking your time to file and issue.
I also learned something new 😄
Steps to reproduce
import CalendarDates from "calendar-dates"; const cal = new CalendarDates(); cal.getMatrix(new Date("2019-05-01")).then(data => { console.log(data); });
Expected behavior
[[{"date":28,"iso":"2019-04-28","type":"previous"},{"date":29,"iso":"2019-04-29","type":"previous"},{"date":30,"iso":"2019-04-30","type":"previous"},{"date":1,"iso":"2019-05-01","type":"current"},{"date":2,"iso":"2019-05-02","type":"current"},{"date":3,"iso":"2019-05-03","type":"current"},{"date":4,"iso":"2019-05-04","type":"current"}],[{"date":5,"iso":"2019-05-05","type":"current"},{"date":6,"iso":"2019-05-06","type":"current"},{"date":7,"iso":"2019-05-07","type":"current"},{"date":8,"iso":"2019-05-08","type":"current"},{"date":9,"iso":"2019-05-09","type":"current"},{"date":10,"iso":"2019-05-10","type":"current"},{"date":11,"iso":"2019-05-11","type":"current"}],[{"date":12,"iso":"2019-05-12","type":"current"},{"date":13,"iso":"2019-05-13","type":"current"},{"date":14,"iso":"2019-05-14","type":"current"},{"date":15,"iso":"2019-05-15","type":"current"},{"date":16,"iso":"2019-05-16","type":"current"},{"date":17,"iso":"2019-05-17","type":"current"},{"date":18,"iso":"2019-05-18","type":"current"}],[{"date":19,"iso":"2019-05-19","type":"current"},{"date":20,"iso":"2019-05-20","type":"current"},{"date":21,"iso":"2019-05-21","type":"current"},{"date":22,"iso":"2019-05-22","type":"current"},{"date":23,"iso":"2019-05-23","type":"current"},{"date":24,"iso":"2019-05-24","type":"current"},{"date":25,"iso":"2019-05-25","type":"current"}],[{"date":26,"iso":"2019-05-26","type":"current"},{"date":27,"iso":"2019-05-27","type":"current"},{"date":28,"iso":"2019-05-28","type":"current"},{"date":29,"iso":"2019-05-29","type":"current"},{"date":30,"iso":"2019-05-30","type":"current"},{"date":31,"iso":"2019-05-31","type":"current"},{"date":1,"iso":"2019-06-01","type":"next"}],[{"date":2,"iso":"2019-06-02","type":"next"},{"date":3,"iso":"2019-06-03","type":"next"},{"date":4,"iso":"2019-06-04","type":"next"},{"date":5,"iso":"2019-06-05","type":"next"},{"date":6,"iso":"2019-06-06","type":"next"},{"date":7,"iso":"2019-06-07","type":"next"},{"date":8,"iso":"2019-06-08","type":"next"}]]
Actual behavior
[[{"date":28,"iso":"2019-04-28","type":"previous"},{"date":29,"iso":"2019-04-29","type":"previous"},{"date":30,"iso":"2019-04-30","type":"previous"},{"date":1,"iso":"2019-04-01","type":"current"},{"date":2,"iso":"2019-05-02","type":"current"},{"date":3,"iso":"2019-05-03","type":"current"},{"date":4,"iso":"2019-05-04","type":"current"}],[{"date":5,"iso":"2019-05-05","type":"current"},{"date":6,"iso":"2019-05-06","type":"current"},{"date":7,"iso":"2019-05-07","type":"current"},{"date":8,"iso":"2019-05-08","type":"current"},{"date":9,"iso":"2019-05-09","type":"current"},{"date":10,"iso":"2019-05-10","type":"current"},{"date":11,"iso":"2019-05-11","type":"current"}],[{"date":12,"iso":"2019-05-12","type":"current"},{"date":13,"iso":"2019-05-13","type":"current"},{"date":14,"iso":"2019-05-14","type":"current"},{"date":15,"iso":"2019-05-15","type":"current"},{"date":16,"iso":"2019-05-16","type":"current"},{"date":17,"iso":"2019-05-17","type":"current"},{"date":18,"iso":"2019-05-18","type":"current"}],[{"date":19,"iso":"2019-05-19","type":"current"},{"date":20,"iso":"2019-05-20","type":"current"},{"date":21,"iso":"2019-05-21","type":"current"},{"date":22,"iso":"2019-05-22","type":"current"},{"date":23,"iso":"2019-05-23","type":"current"},{"date":24,"iso":"2019-05-24","type":"current"},{"date":25,"iso":"2019-05-25","type":"current"}],[{"date":26,"iso":"2019-05-26","type":"current"},{"date":27,"iso":"2019-05-27","type":"current"},{"date":28,"iso":"2019-05-28","type":"current"},{"date":29,"iso":"2019-05-29","type":"current"},{"date":30,"iso":"2019-05-30","type":"current"},{"date":31,"iso":"2019-05-31","type":"current"},{"date":1,"iso":"2019-05-01","type":"next"}],[{"date":2,"iso":"2019-06-02","type":"next"},{"date":3,"iso":"2019-06-03","type":"next"},{"date":4,"iso":"2019-06-04","type":"next"},{"date":5,"iso":"2019-06-05","type":"next"},{"date":6,"iso":"2019-06-06","type":"next"},{"date":7,"iso":"2019-06-07","type":"next"},{"date":8,"iso":"2019-06-08","type":"next"}]]
Environment data
npm --version: 6.4.1
"calendar-dates": "^2.5.12",