wizbots / labtab

0 stars 0 forks source link

Use current year for year dropdown in lab list #107

Closed internetmosquito closed 5 years ago

internetmosquito commented 5 years ago

Current year is set to 2017 in year selector in drop down

screenshot_20190107-111305_labtab

Two things to do here:

internetmosquito commented 5 years ago

@kapoorutd Please don't close tickets

internetmosquito commented 5 years ago

@kapoorutd I don't see you're getting current year but just adding 2019 entry

https://github.com/wizbots/labtab/commit/8f84ee25ec1e7783ba5be0c9e56e26710ea7619f#diff-01dafb3fd0217441330103cfc8300094R223

This is not what I requested, I'm asking to get current year from current time and use that instead, not something hardcoded

kapoorutd commented 5 years ago

@internetmosquito In Previous flow we have hard coded values for years (2011 to 2018), current year is 2019 and if we add 2019 to hard coded array and it will become 2011 to 2019 for now and works fine, but when current year will be 2020 this logic only add current year to list, so new list will be 2011 to 2018 and 2020 (2019 is missing).

What we suggest to avoid this bug is that, we remove all hardcoded values for year and made list of years at run time which have 5 years : current year and 4 previous years. Example : current year is 2019, list will be 2015 to 2019 If current year will be 2020, list will be 2015 to 2020 (this case is also have a bug, suppose if user have wrong time in their device (suppose 1 Jan, 1999), then Labtab app will show wrong years (1994 to 1999)).

Please confirm which case you want us to implement.

internetmosquito commented 5 years ago

@kapoorutd agreed, but make default year current one please. Remove all hardcoded values, list of years will be from current year minus 4 years