Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: RowaN on May 07, 2007, 04:51:41 PM

Title: Display month name in WPS?
Post by: RowaN on May 07, 2007, 04:51:41 PM
With the recent changes to RTC stuff in Rockbox, I'm trying to sync my WPS, but having problems with month (and day). It returns a number now instead of the name (e.g. 1 instead of January). From what I could gain from reading the WPS wiki page on conditionals, I tried:

Quote
%?cm(January|February|March|April|May|June|July|August|September|October|November|December)
[I have replaced the V-shaped brackets with normal brackets in the above line because this forum was not displaying them properly.]

..but that doesnt seem to work. I also looked through many pages of existing WPS but couldnt find any that show the month name. Can someone shed some light on this for me please?
Title: Re: Display month name in WPS?
Post by: ColdSphinx on May 08, 2007, 11:41:13 AM
Is it necessari for you that the monthname is comlete shown like "January"?
If not you could use:
Code: [Select]
%cb - abbreviated month name (Jan..Dec)


It returns a number now instead of the name (e.g. 1 instead of January)
It returns "01" for January.
Title: Re: Display month name in WPS?
Post by: RowaN on May 08, 2007, 12:26:43 PM
Yes, I am trying to display the month name, not an abbriviation. Is it possible? Why is my conditional tag not working?
Title: Re: Display month name in WPS?
Post by: ColdSphinx on May 08, 2007, 12:51:04 PM
It's an bug caused by the formating. 01,02,03,04,..,10,11,12
Title: Re: Display month name in WPS?
Post by: RowaN on May 08, 2007, 04:38:23 PM
Thanks for info. I've added it as a bug here:
www.rockbox.org/tracker/task/7133
Title: Re: Display month name in WPS?
Post by: NicolasP on May 08, 2007, 04:56:36 PM
The fact that your conditional doesn't work isn't caused by the leading zero. It's because the RTC tags aren't currently meant to be used as conditionals. It's not hard to fix but I'm not sure it's worth the added code size.
Title: Re: Display month name in WPS?
Post by: Lear on May 09, 2007, 03:59:19 AM
Setting intval in a couple of places shouldn't add much code...
Title: Re: Display month name in WPS?
Post by: NicolasP on May 21, 2007, 08:55:12 AM
Done.
Title: Re: Display month name in WPS?
Post by: RowaN on May 21, 2007, 05:18:43 PM
My example code still doesnt work, even after your commit. Can you give some example code that works please?
Title: Re: Display month name in WPS?
Post by: elborak on May 21, 2007, 07:21:11 PM
Nicolas already updated the wiki to include examples. Do those not work?
Title: Re: Display month name in WPS?
Post by: RowaN on May 22, 2007, 08:37:44 AM
The example in the wiki (http://www.rockbox.org/twiki/bin/view/Main/CustomWPS) is the same as my example above, which does not work.
Title: Re: Display month name in WPS?
Post by: Llorean on May 22, 2007, 12:54:49 PM
What SVN revision are you using? The actual number please.
Title: Re: Display month name in WPS?
Post by: RowaN on May 22, 2007, 02:51:43 PM
Sorry, it does work on real hardware, just tested with todays build.  :)

I was testing on a recent sim build with rockbox r13390-070515.