It works fine on my watch, but users claimes that dates are shifted. So, may someone help me ti figure out what I doing wrong?
Here is a parts of code:
using Toybox.Time as Tm;
using Toybox.Time.Gregorian as Tmg;
// get current datetime, store current month
var curtime = Tm.today();
var grinfo_s = Tmg.info(curtime, Tmg.FORMAT_SHORT);
var cur_month = grinfo_s.month;
// by default display_month = current month
var display_month = cur_month;
...
function onUpdate(dc) {
...
// get displayed month start, next month start (to calculate days_in_month)
var m_start = Tmg.moment({:day=>1,:month=>display_month});
var m_end = Tmg.moment({:day=>1,:month=>display_month + 1});
// print dispayed month name
var grinfo = Tmg.info(m_start, Tmg.FORMAT_LONG);
dc.drawText(..., grinfo.month, ...);
...
}
...
// handling menu
function onMenuItem(item) {
...
// "January" - 1, etc...
if ( item == :item_1 ) {
display_month = 1;
...
feedbacks are:
When i choose January, it's displaying December. It is also showing today as the Thursday the 29th, when it should be Saturday the 30th.
When selecting February is showing January but has only 29 days.
The very strange thing is that on my watch there are no such problems, monthes displayed exactly the same as in real calendar. Same for some users according to positive feedbacks, can't guess the dependencies.
And for now I don't know what to do...