Widget: CalendarWidget

Former Member
Former Member


Simple calendar view.

Start button: fast rotated current, past and next month.
Press and hold menu: select month to view or change (and store) first day of week You want.

0.0.1 - Initial
0.0.2 - change
- change get current time from Calendar.new() to Calendar.today() - maybe it is problem in other timezones
- press and hold menu button to change first day of week
0.0.3 - change 920xt compatibility - test compliation
0.0.4 - test compilation for vivo and epic
- tune height layout elements to 148px displays
- add timezone offset to date (shift calendar error in 'negative' timezones after utc midnight).
0.0.5 - add menu with options:
- select year 2013-2017 and month to view
- change first day of week
  • Former Member
    Former Member over 10 years ago
    Comments: markkinn
    Option to select Monday as week first day

    Good think. I try read this one from system settings.
  • Former Member
    Former Member over 10 years ago
    Coments: cdilascia 31/3/2015 Version 0.0.1
    "February 1st 2/1/15 was on a Sunday. March 1st 3/1/15 was on a Sunday. April 1st 4/1/15 is on a Wednesday. Thus all three months in the app are wrong and do not have accurate calendars for these months. Thus, the app is useless."

    2/1/15 Sunday - yes
    3/1/15 Sunday - yes
    4/1/15 Wednesday - yes

    What is wrong, what you see. Today is 4/1 but in another timezones is 3/31 maybe I wrong calculate actual month? But must have more information about problem, about time, your timezone etc.

    Try next version.
  • Former Member
    Former Member over 10 years ago
    Comment: Roweac 31 marzec 2015 Version 0.0.1
    "Today is April 1 2015 but the widget is showing March 1 2015. I checked the time and date on the watch, rebooted and re-synced with satellites and it is still the same. Nice to have the month view back but would like it to be accurate."

    I think it's timezone problem. I get local date by Calendar.new(), get year, month, prepare (options) at (year-month-01 00:00:00) and calculate day-of-week offset.
    In my opinion Calendar.moment(options) genarate (moment) in another timezone, and I get past month as current. This is dificult to debug, I can't change time, date, tz on my f3 and simulator :( I have only simulated hardcoded timestamps in unix epoc :(

    Try next version, I change now() to today() method - this maybe help.
  • updated and seems to work great now. Thanks!!
  • Former Member
    Former Member over 10 years ago
    Uhhh :D
    I'm resolve problem with 'timezones' :)

    I'm use code like this:

    tera = Time.now();
    tein = Calendar.info(tera, Time.FORMAT_SHORT);

    xmon=tein.month;
    xyear=tein.year;
    xday=tein.day;

    // modify xmon,xyear +-1 on user select

    // prepare date - first day of month
    options = { :second => 0, :hour => 0, :minute => 0,
    :year => xyear, :month => xmon, :day => 1};
    now = Calendar.moment(options);
    // this is medication: now = now.add(new Time.Duration(clockTime.timeZoneOffset*-1));
    info = Calendar.info(now, Time.FORMAT_SHORT);
    // System.println(info.day); // show 1/4 or 31/3!
    ofset=info.day_of_week;

    But 'now' is in UTC! and info.day return -1 day on west after 'utc midnight' if user is has negative offset!
    unfortunately on my f3 I can't change the tz and date for test! Usefull is the sim and change tz and time on laptop. If You want test an app on diferents timezonest - this is the ansfer.

    In a moment I make new version of calendar :)
  • Thanks for the fix, it works great now on my 920 for PDT. I was hoping I didn't have to move time zones :)
  • Former Member
    Former Member over 10 years ago
    bwd1: please run the widget after 0:00UTC in your timezone, and check days of week.
    I'll think about month selector in menu :)
    Three month in quick access, and another months from menu.
  • 00:45 UTC still works :) The planned updates sound great.
  • Former Member
    Former Member over 10 years ago
    Good news :) Test on a 'bare metal' is the best :) I had concerns about osx and f3 simulator.
  • Former Member
    Former Member over 10 years ago
    0.0.5 - add menu with options:
    - select year 2013-2017 and month to view
    - change first day of week