It is currently April 28th, 2024, 9:49 am

Date fix for ExMouth

Get help with creating, editing & fixing problems with skins
User avatar
heath28m
Posts: 14
Joined: March 28th, 2010, 9:56 am

Date fix for ExMouth

Post by heath28m »

I hate to create a new Topic for this... BUT I am using the ExMouth Time ad Date skin.. I have two versions of it for some reason..both the same except for color.. To the point..

Please keep in mind I am not the Author.. I simple was wondering about fixing this myself.. :P for me..

This part of the code actually shows incorrectly ( not for sure about the GER version.. )

Code: Select all

[MeasureDate]
Measure=Time
Format="%#A the %dth of %B"
Substitute="01":"1","02":"2","03":"3","04":"4","05":"5","06":"6","07":"7","08":"8","09":"9"
The reason this shows up wrong is that not ever day number ends with a 'th' Like 1th of November for example should show as 1st of November.. I know I have a config which has this worked out because I remember editing it.. but I have hundreds of them... Haven't found it yet and could have since been erased..

Currently I have started an edit to it which seems to work and was wondering if this is the correct or suggested method and/or should I do this for all days.. In other words is this the most efficient method.. with less impact on performance and code structure so on..

Code: Select all

[MeasureDate]
Measure=Time
Format="%#A the %d of %B"
Substitute="01":"1st","02":"2nd","03":"3rd","04":"4th","05":"5th","06":"6th","07":"7th","08":"8th","09":"9th"
Thanks for any input on this.. Now I know why people stick to 11.01.11 format...
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Date fix for ExMouth

Post by smurfier »

Code: Select all

[Weekday]
Measure=Time
Format="%#A"

[Day]
Measure=Time
Format="%d"

[DayLabel]
Measure=Calc
Formula=(Day%10)>4?4:Day%10
Substitute="1":"st","2":"nd","3":"rd","4":"th","0":"th"

[Month]
Measure=Time
Format="%B"

[MeterString]
Meter=String
MeasureName=Weekday
MeasureName2=Day
MeasureName3=DayLabel
MeasureName4=Month
Text="%1 the %2%3 of %4"
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
kail
Posts: 1
Joined: December 2nd, 2011, 6:20 pm

Re: Date fix for ExMouth

Post by kail »

Shouldn't the above Formula line look more like this..

Code: Select all

Formula=(Day%10>4)||((Day>10)&&(Day<14))?4:Day%10
.. to cater for the 11th, 12th and 13th?
Two wrongs don't make a right, but three lefts do.