You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The views use a page controller allowing methods like JumpToPage to move the view to a specific page.
The issue is that, how the pageIndex is related to a date isn't documented.
In digging through the code the index is based on the minDay argument (which is actually a date and perhaps poorly named).
If minDay isn't passed the the epocDate is used (1900/1/1).
Then the index is calculated as the numbers of days since minDay.
The maths is different for a month and week with and alignment operation occuring (to the first day of the month or week).
So the maths is actually slightly non-trivial and it must be right or things go awry.
The result is that the likes of jumpToPage is impossible to use without this documentation.
The maths is complicated enough that I think we should expose a method to translate between the index/date and back.
For reference I'm creating a single page that allows a user to move between views (day, week, month) and the 'current' date needs to be retained as the users swaps.
As the pageIndex is different for a given date I need to translate between page indexes on the different views so knowing how it is calculated is critical to a correct implementation.
The text was updated successfully, but these errors were encountered:
The views use a page controller allowing methods like JumpToPage to move the view to a specific page.
The issue is that, how the pageIndex is related to a date isn't documented.
In digging through the code the index is based on the minDay argument (which is actually a date and perhaps poorly named).
If minDay isn't passed the the epocDate is used (1900/1/1).
Then the index is calculated as the numbers of days since minDay.
The maths is different for a month and week with and alignment operation occuring (to the first day of the month or week).
So the maths is actually slightly non-trivial and it must be right or things go awry.
The result is that the likes of jumpToPage is impossible to use without this documentation.
The maths is complicated enough that I think we should expose a method to translate between the index/date and back.
For reference I'm creating a single page that allows a user to move between views (day, week, month) and the 'current' date needs to be retained as the users swaps.
As the pageIndex is different for a given date I need to translate between page indexes on the different views so knowing how it is calculated is critical to a correct implementation.
The text was updated successfully, but these errors were encountered: