TodayPlus Boards v2

TodayPlus for the Pocket PC Forums => HammerSkin => Topic started by: dgmele on December 30, 2004, 11:12:10 PM

Title: Counting
Post by: dgmele on December 30, 2004, 11:12:10 PM
Is there a way of having the week number count from Sunday instead of Monday? Presently, Sunday, January 2, 2005, is counted as week 53. Week 1 does not start its count until Monday, January 3, 2005.

Also, it would be nice if the countdown feature could be added to the Appointments page. I had this feature in the previous skin I had been using before the spectacular Hammerskin came along.
Title: Counting
Post by: Motormuis on December 31, 2004, 03:20:06 AM
This is because week 1 starts at januari 3 and not on januari 2. Januari 2 is still week 53.
Title: Counting
Post by: dgmele on December 31, 2004, 03:28:54 AM
If you consider Monday the start day, this is so. However, if you consider Sunday the start day, this is not so. Both methods are possible. I prefer to use Sunday as the start day and would like to alter the skin accordingly. Does anyone know if there is a simple way to do this?
Title: Counting
Post by: Motormuis on December 31, 2004, 03:40:20 AM
It's not me that considers that a week starts on a monday, but this is regarding ISO8601-standards.
Quote" In commercial and industrial applications (delivery times, production plans, etc.), especially in Europe, it is often required to refer to a week of a year. Week 01 of a year is per definition the first week that has the Thursday in this year, which is equivalent to the week that contains the fourth day of January. In other words, the first week of a new year is the week that has the majority of its days in the new year. Week 01 might also contain days from the previous year and the week before week 01 of a year is the last week (52 or 53) of the previous year even if it contains days from the new year. A week starts with Monday (day 1) and ends with Sunday (day 7). "
I hope this explains it?
Title: Counting
Post by: dgmele on December 31, 2004, 04:00:15 AM
Forgive me. I did not mean "you" personally. I accept the standard you quote. However, I have seen different date programs do things differently. The Calendar Program on the PocketPC, for example, allows the user to begin the week with Sunday (as does the TodayPlus program). If you change the Calendar Program setting on the Options screen to "Show week numbers," the first week is shown as beginning on Sunday. This may not be entirely accurate according the quoted standard, but it is what I would like to do. If you know a simple way to accomplish this, I would appreciate your help. Thanks.
Title: Counting
Post by: uk_skinner on December 31, 2004, 05:26:41 AM
dgmele:

 Try these codes:

   if,var,var33,,<,38354
         //Jahr 2004
         addvar,var33,-37978
   else
      if,var,var33,,<,38718
         //Jahr 2005
         addvar,var33,-38347
      else
         if,var,var33,,<,39082
            //Jahr 2006
            addvar,var33,-38711
         else
            //Jahr 2007
            addvar,var33,-39075
         endif
      endif
   endif

The week start at Sun.  

02-Jan-2005(Sun): 1st week
31-Dec-2005(Sat): 52th week
01-Jan-2007(Sun): 1st week
31-Dec-2006(Sun): 1st week
01-Jan-2007(Mon): 1st week
Title: Counting
Post by: dgmele on December 31, 2004, 02:37:36 PM
Thanks once again. Works perfectly.

I don't know whether you read the second part of my original post about the possibility of implementing the countdown feature in the Appointments section. Would this be a monumental task?
Title: Counting
Post by: uk_skinner on December 31, 2004, 07:05:45 PM
Quote from: dgmeleThanks once again. Works perfectly.

I don't know whether you read the second part of my original post about the possibility of implementing the countdown feature in the Appointments section. Would this be a monumental task?

Sorry, I missed that part of your post.. :oops:

If you are looking something like this.  Just use the codes here.  Since there are some other symbols in the events, you probably need to adjust the position to fit your need.  The countdown codes are in red.

   options,apptformat,0,11,11,%tab,35%%countdown, Day,H 'hrs',m 'min'%%iconstart,67%%sensitivityicon,-10,1,private sensitivity.png,normal sensitivity,tr%%recurrenceicon,-10,1,recurrence.png,tr%%remindericon,-10,1,reminder.png,tr%%changefont,tahoma,11,%%image,0,2,small_arrow_right.png,tr%%tab,7%%starttime,HH:mm%%tab,76%%subject%%regularfont%

   options,apptallday,0,11,11,%tab,35%%countdown, Day%%iconstart,67%%sensitivityicon,-10,1,private sensitivity.png,normal sensitivity,tr%%recurrenceicon,-10,1,recurrence.png,tr%%remindericon,-10,1,reminder.png,tr%%changefont,tahoma,11,%%textcolor,0_128_0%%image,0,2,small_arrow_right.png,tr%%tab,7%All Day%tab,76%%subject%%regularfont%%resettextcolor%
Title: Countdown
Post by: dgmele on January 01, 2005, 02:38:46 AM
I'll try to incorporate. Will let you know if I have any success.

By the way, is the daylength function not functional? I get a minus reading for "length" on the Weather page.
Title: Re: Countdown
Post by: uk_skinner on January 01, 2005, 10:11:29 AM
Quote from: dgmele
By the way, is the daylength function not functional? I get a minus reading for "length" on the Weather page.

Indeed, at some location, you will get minus day length.  No one but srs can fix that.. :oops:
Title: Daylength
Post by: dgmele on January 01, 2005, 02:05:31 PM
How about creating a calculation that simply substracts the sunrise time from the sunset time? Would that work? I'd do it if I knew how but am very limited in what I am able to accomplish.
Title: Re: Daylength
Post by: uk_skinner on January 01, 2005, 02:17:25 PM
Quote from: dgmeleHow about creating a calculation that simply substracts the sunrise time from the sunset time? Would that work? I'd do it if I knew how but am very limited in what I am able to accomplish.

As far as I know, the rais/set time CAN NOT BE assigned to the var.  So can not do the calculation..  Sorry...
Title: Counting
Post by: dgmele on January 01, 2005, 02:30:44 PM
Oh, well. Can't have everything. I'll probably just replace length with elevation or something like that.

Sorry to keep bothering you, but is there a way of making the number of the present day a different color, red for example? It's nice that it's bold, but my eyesight requires that I look very closely. A different color would help greatly.
Title: Counting
Post by: uk_skinner on January 01, 2005, 02:45:08 PM
Quote from: dgmeleOh, well. Can't have everything. I'll probably just replace length with elevation or something like that.

Sorry to keep bothering you, but is there a way of making the number of the present day a different color, red for example? It's nice that it's bold, but my eyesight requires that I look very closely. A different color would help greatly.


Use "color,font,255_0_0" before your date/time, but remember change back to "color,font,-1_4,-1" (Today Screen Text Color", otherwise you have something in the red...


   changefont,tahoma,23,i

       color,font,255_0_0

   time,4,0,-1,5,ls,"dddd",

   changefont,tahoma,13,b

   time,4,22,-1,5,l,"d.MMMM yyyy",
   time,4,35,-1,4,l
        color,font,-1_4_-1


   changefont,tahoma,12,
Title: Re: Countdown
Post by: Wichtel on January 01, 2005, 03:14:16 PM
Quote from: dgmeleI'll try to incorporate. Will let you know if I have any success.

By the way, is the daylength function not functional? I get a minus reading for "length" on the Weather page.

For the "minus" try the following: If you have an City e.G. 49.899,-97.130 make sure that you type only 5 letters in the Registry. In the example -97.130 is -97.13
On my Device this works without an minus
Title: Counting
Post by: uk_skinner on January 01, 2005, 03:25:42 PM
Wichtel:

 Can you try (47.61,-122.3) Vancouver?  I double checked the number were correct in registry key, but the length of day is still minus...
Title: Counting
Post by: Wichtel on January 01, 2005, 03:46:23 PM
Cool: there is an Bug if you have an entry with three letters bevore the dot e.G. -123.1 the minus is shown. If you have an entry with two letters before the dot e.G. -12.31 the minus isn“t shown and the Daylength will be correct displayed

Uk:no luck with Vancouver  :(
Title: Counting
Post by: uk_skinner on January 01, 2005, 03:56:23 PM
Thanks Wichtel...

Another bug???  If you uses "countdown", the number of days for all-day and appointment are different... :?  :?
Title: Color Date
Post by: dgmele on January 01, 2005, 04:03:26 PM
Hi, UK,

The date number that I want to change color for is the one in the Calendar (on the Today, Appointment, and Task screens), where the NUMBER of the present day is in bold. I would like to make it bold AND red. Sorry if I'm not making myself clear.
Title: Re: Color Date
Post by: uk_skinner on January 01, 2005, 04:17:24 PM
Quote from: dgmeleHi, UK,

The date number that I want to change color for is the one in the Calendar (on the Today, Appointment, and Task screens), where the NUMBER of the present day is in bold. I would like to make it bold AND red. Sorry if I'm not making myself clear.

Then use this:
options,dateformat,1,15,15,%changefont,tahoma,11,%%line,202,10,-1_4_-1%%textcolor,196_0_0%%bold%%date,l%%regularfont%%resettextcolor%

It will change all you date into red.  At this moment, I don't know how to change different color for today or tomorrow.  Anyone, any idea?
Title: Re: Color Date
Post by: Wichtel on January 01, 2005, 04:26:24 PM
Quote from: uk_skinner
It will change all you date into red.  At this moment, I don't know how to change different color for today or tomorrow.  Anyone, any idea?

There is no solution for different colors for today or tomorrow. Everyone  the same or nothing at all.
Title: Counting
Post by: dgmele on January 02, 2005, 03:10:47 AM
I'm afraid that I have still not made myself clear. The bolded number signifying today's date that I am referring to is in the calendar in the upper right hand corner of the Today page (and in the bottom half of the Appointment and Task pages):

S M T W T F S
1 2 3  4 5 6 7 . . .

I seem to recall a discussion way back when that concluded there is no way to change the color (except by srs). Time to give up on this one, I guess. Thanks anyway.
Title: Counting
Post by: uk_skinner on January 02, 2005, 06:50:59 AM
dgmele:

 Sorry to get that wrong again.   :oops:

  Maybe there is a possibility but it might not be perfect.  I will try some experiment and let you know it can be done or not.

Edit:  Sorry, my idea was too naive... :roll:  :?
Title: Counting
Post by: uk_skinner on January 02, 2005, 10:25:58 AM
Well, after several hours of experiment, I think I have something like this:

1)  Right now, only will work on the calendar on the Main page.

2)  Your firstoutlookday will be labelled as "red" color.

3) If you tap anyday on the calendar, that day will be labelled as "red" and the poom section will updated as usual.  The today will still be bold.

4)  At this moment, I worked out only for Jan and I will see I can work it out at least for 2005.
Title: Counting
Post by: dgmele on January 02, 2005, 12:29:08 PM
Amazing! How did you do it?
Title: Counting
Post by: uk_skinner on January 02, 2005, 12:34:00 PM
Quote from: dgmeleAmazing! How did you do it?


If I can get it done, I will try to post the codes here by today.  At this moment, I only can get it work on main page not in agenda section.  :)
Title: Counting
Post by: uk_skinner on January 02, 2005, 09:55:23 PM
dgmele:

  Just finished the codes.  This is the "beta-test" codes.  Get a lot of room to improve.  This is only for 2005.  It gives us one year to figure out the better solution. :lol:

 The idea was very simple.  Use calcvar to get firstoutlookday.  It is normally  today's day.  Based on the number do a serial calculation to get the right corrdinate for the "position" of day on the calendar.  Then just text the day with specified "bold" "color".  

 Since I need a lot of var to do the caculation, I "recycled" the vars from other section.  As far as I can tell now, it did not affect the function of other sections since the vars were reset back to default values when you switch.  However, I would suggest you to keep the eyes on it.  All the codes are just before the end of region 5 (except one in the region 2).  If you sense anything wrong, just delete the codes.

 So here are the codes.  The new ones are in red.  

region,2,0,20
....
   //========================================
   // CALENDAR CURRENT MONTH
   //========================================

   image,115,5,kalender_header_main.png
   image,181,5,kalender_header_senkrecht_main_grau.png
   image,194,5,kalender_header_senkrecht_main_rot.png

   color,font,0_0_0
   calendarheader,116,5,13
   color,font,-1_4_-1
   
   calendar,0,0,116,18,13,10,l

   button,116,18,91,60,-1,23,0,5
   button,116,18,91,60,-1,23,1,5
   button,116,18,91,60,-1,23,2,5
   button,116,18,91,60,-1,23,3,5
   button,116,18,91,60,-1,5,-highlight,5
   button,116,18,91,60,2,4,0,
......

endregion2,0

region,5,0,-1
.....
.....
// Angabe der calendar week (KW) of the year

      calcvar,var33,firstoutlookday

   if,var,var33,,<,38354
         //Jahr 2004
         addvar,var33,-37978
   else
      if,var,var33,,<,38718
         //Jahr 2005
         addvar,var33,-38347
      else
         if,var,var33,,<,39082
            //Jahr 2006
            addvar,var33,-38711
         else
            //Jahr 2007
            addvar,var33,-39075
         endif
      endif
   endif

   calcvar,var32,/,%var33%,7

   changefont,tahoma,10b

   text,205,126,%var32%th Week,r
   
   changefont,tahoma,12

//==========================================
// Highlight the firstoutlookday in calendar
//==========================================


calcvar,var33,firstoutlookday

   if,var,var33,38353,><,38383
      storevar,var2=38353
      storevar,var26=6
   else

      if,var,var33,38384,><,38411
         storevar,var2=38384
         storevar,var26=2
      else
         if,var,var33,38412,><,38442
            storevar,var2=38412
            storevar,var26=2
         else
            if,var,var33,38443,><,38472
               storevar,var2=38443
               storevar,var26=5
            else
               if,var,var33,38473,><,38503
                  storevar,var2=38473
                  storevar,var26=0
               else
                  if,var,var33,38504,><,38533
                     storevar,var2=38504
                     storevar,var26=3
                  else

                     if,var,var33,38534,><,38564
                        storevar,var2=38534
                        storevar,var26=5
                     else
                     
                        if,var,var33,38565,><,38595
                           storevar,var2=38565
                           storevar,var26=1
                        else
                           if,var,var33,38596,><,38625
                              storevar,var2=38596
                              storevar,var26=4
                           else
                              if,var,var33,38626,><,38656
                                 storevar,var2=38626
                                 storevar,var26=6
                              else
                                 if,var,var33,38657,><,38686
                                    storevar,var2=38657
                                    storevar,var26=2
                                 else
                                    if,var,var33,38687,><,38717
                                       storevar,var2=38687
                                       storevar,var26=4
                                    else
                                    endif
                                 endif
                              endif
                           endif
                        endif
                     endif
                  endif
               endif
            endif
         endif
      endif
   endif
   calcvar,var8,-,%var33%,%var2%
   storevar,var27=%var8%
   calcvar,var27,+,%var27%,1
   calcvar,var8,+,%var8%,%var26%
   calcvar,var11,/,%var8%,7
   calcvar,var11,*,%var11%,7
   calcvar,var8,-,%var8%,%var11%
   calcvar,var12,-,%var33%,%var2%
   calcvar,var12,+,%var12%,%var26%
   calcvar,var12,/,%var12%,7
   calcvar,var12,+,%var12%,1
   calcvar,var8,*,%var8%,13
   calcvar,var8,+,%var8%,122
   calcvar,var12,*,%var12%,10
   calcvar,var12,+,%var12%,7
   color,font,196_0_0
   changefont,tahoma,12,b
   text,%var8%,%var12%,%var27%,c
   color,font,-1_4_-1
   changefont,tahoma,12,   
   

endregion,5,0
Title: Counting
Post by: dgmele on January 03, 2005, 12:29:18 AM
Hi, uk_skinner,

Thanks for all your hard work. However, although I've checked everything very carefully I'm not having any success in getting the codes to work. I'm using the lastest skin (1.05.5 QVGA Eng) and have pasted the codes in red in the appropriate areas, but I lose all the right-side icons on the Main page, the News Ticker headlines have disappeared, and the date though bold is still black. Can't get to any of the other pages. I clearly have done something wrong, but am not skilled enough to know what. I've attached my pasted skin should you be interested in seeing where I went wrong.
Title: Counting
Post by: uk_skinner on January 03, 2005, 06:28:38 AM
dgmele:

  I got the same problem when I used your posted skin.  However, after I replaced the caculation portion from mine into yours, everything looked fine.  And I was pretty sure that I did copy/paste the codes from my skin into forum.  So far, no clue what happened.  Anyway, please try this skin.
Title: Counting
Post by: thc on January 03, 2005, 06:44:00 AM
hi uk_skinner,

looks great!  :D
i try to modify vars for VGA but i'm not enough good for it...:cry:

this is the part of calendar code:

//========================================
   // Calendar - Current Month
   //========================================

   image,230,10,kalender_header_main.png
   image,362,10,kalender_header_senkrecht_main_grau.png
   image,388,10,kalender_header_senkrecht_main_rot.png

   calendarheader,232,10,26

   calendar,0,0,232,36,26,20,l

   button,232,36,182,120,-1,23,0,5
   button,232,36,182,120,-1,23,1,5
   button,232,36,182,120,-1,23,2,5
   button,232,36,182,120,-1,23,3,5
   button,232,36,182,120,-1,5,-highlight,5  

if it's not abuse, can you give me the correct var?

thank's
thc
Title: Counting
Post by: uk_skinner on January 03, 2005, 06:52:52 AM
thc:

 Calculations should be the same but the (x,y) of the day on the calendar need to be adjusted.  Let me work on it and report back to you.
Title: Counting
Post by: thc on January 03, 2005, 06:54:47 AM
thank's a lot!  :D
Title: Counting
Post by: uk_skinner on January 03, 2005, 07:10:19 AM
thc:

 Here it is.  But one more thing, I start my calendar at Sunday.  How about you?  If you start at Monday, then I need to adjust the (x,y).
Title: If you start your calendar on Monday
Post by: uk_skinner on January 03, 2005, 07:21:03 AM
Please add the codes under 12 "endif" codes.  That will adjust the position of "color-label" number.

calcvar,var26,-,%var26%,1
if,var,var26,,<,0
storevar,var26=6
else
endif
Title: Counting
Post by: thc on January 03, 2005, 08:30:05 AM
thank's uk_skinner,

work's perferct!  :clap:
just need to switch mine calendar with yours... :wink:
Title: Counting
Post by: uk_skinner on January 03, 2005, 09:07:53 AM
Quote from: thcthank's uk_skinner,

work's perferct!  :clap:
just need to switch mine calendar with yours... :wink:

thc:

If your calendar starts on Monday, just add the codes I posted above and it should work as well.
Title: Counting
Post by: thc on January 03, 2005, 10:26:56 AM
allready done! when i said just switch calendar with yours, it's for position of calendar in main page.
everything works fine.
thank's again!  :D
Title: Counting
Post by: dgmele on January 03, 2005, 03:17:54 PM
It works. Don't know what I did wrong. Thanks. You are so good.
Title: Re: Color Date
Post by: nas on January 04, 2005, 05:45:21 AM
Quote from: uk_skinnerAt this moment, I don't know how to change different color for today or tomorrow.  Anyone, any idea?

Hi uk_skinner,

maybe it is possible (a little bit = screenshot), a small idea.

Four steps:

1. Free REGION without automatical update/reset (ex.)
        region,11,0,-1           
   calcvar,var50,firstoutlookday
   endregion,11,0
   

2. Add to the top of the skin
   initregion,11,0

3. Jump to the free region (from calendar-reset)
   imagebutton,160,86,NA_kalender_reset1.png,t,-1,10,0,2
   button,160,86,62,12,-1,22,0,2
   button,160,86,62,12,-1,23,0,2
   ...
        button,160,86,62,12,11,4,0   

4. Another new or known "var" with firstoutlookdate in it
   and one if...else-statement for the colour-change in
   the Main-Page-Agenda-Region

   calcvar,var51,firstoutlookday

   options,calendarfilter,1
   options,taskfilter,1
   options,dateformat,3,15,18,%changefont,tahoma...
   options,today-text,'Heute' - d. MMMM
   options,tomorrow-text,'Morgen' - d. MMMM

        if,var,var51,,=,%var50%
      options,today-text,'           ' - d. MMMM
      color,font,255_0_0
      changefont,tahoma,12,b
      text,25,104,Heute,l
   else
   endif
   
   color,font,0_0_0
   changefont,tahoma,11
         
   options,apptformat,0,11,13,%iconstar...
   options,apptallday,0,11,13,%iconstart...

This example works on the main-page only at the top
of the Agenda (= firstoutlook). I think it will works with
other settings with the POOM-Regions (9 and 10) too.

The var50 (see 1.) will not change automatical at midnight.
You need a normal calender-reset (see 3.)
or a Soft-Reset (see 2.) i`ve found no other way.

Greetings nas
[/url][/list][/code]
Title: Counting
Post by: uk_skinner on January 04, 2005, 06:18:08 AM
nas:

 Interesting idea.... :approve:

  Let me see I can put it into Hammerskin.  Although dgmele did not ask for it (I misunderstood his question), but we always like to see we can find new thing, right?


 Thanks a lot..

Edit:

 nas's approach worked great.  The color of "Today" can be changed.

  Here are my observations:

1)  As nas pointed out, the first "calcvar,var50,firstoutlookday" needs to be frozen.  Therefore, the skin needs to be restarted the first thing each moning.

2)  If you don't have any agenda in "today" then the color-label text will overlap with the date where you have your first agenda.

Other than that, this works great...
Title: Hammer Skin Count
Post by: dgmele on January 10, 2005, 04:05:23 AM
Hi, U_K Skinner,

Here's my experimental modified skin with a countdown section. Since I don't use tasks, I used the Tasks section for Countdown. It's very sloooow to update. If you can figure out why, I'd greatly appreciate it.
Title: Counting
Post by: uk_skinner on January 10, 2005, 06:48:07 AM
Try to change these two codes in region,10

was:
options,calendarfilter,countdown
to:
options,calendarfilter,1


was
outlook,4,%var11%,205,%var8%,1,0,%var12%,,var19,9
to
outlook,4,%var11%,205,%var8%,1,0,%var12%,,var19,10


:wink:  :wink:
Title: Counting
Post by: dgmele on January 10, 2005, 12:43:34 PM
Thanks. Works perfectly--of course!