It is currently May 4th, 2024, 3:05 am

(Solved)Issue creating Word Clock

Get help with creating, editing & fixing problems with skins
Iósua
Posts: 2
Joined: April 16th, 2012, 6:23 pm

(Solved)Issue creating Word Clock

Post by Iósua »

Edit: Issue resolved, the working code is 2nd reply from top.

I am completely new to Rainmeter and it's configuration files, however it seems to be the perfect application for what I want to do.

There are a few 'grid' layout word clocks - that is clocks that tell the time in natural language (ie. "it's ten to five in the afternoon") - but none I found simply gave the time as a single string.

Scavenging code from other projects and struggling through help files I managed to frankenstein this input;

Code: Select all

[Variables]
minutes=%M
hours=%H
Through this long, painfully written out substitution

Code: Select all

[MeasureTime]
Measure=Time
Format=It is M#minutes# H#hours#.
Substitute="M00":"","M01":"","M02":"","M03":"five after","M04":"five after","M05":"five after","M06":"five after","M07":"five after","M08":"ten after","M09":"ten after","M10":"ten after","M11":"ten after","M12":"ten after","M13":"a quarter after","M14":"a quarter after","M15":"a quarter after","M16":"a quarter after","M17":"a quarter after","M18":"twenty after","M19":"a quarter after","M20":"a quarter after","M21":"a quarter after","M22":"a quarter after","M23":"twenty-five after","M24":"twenty-five after","M25":"twenty-five after","M26":"twenty-five after","M27":"twenty-five after","M28":"half past","M29":"half past","M30":"half past","M31":"half past","M32":"half past","M33":"half past","M34":"thirty five after","M35":"thirty five after","M36":"thirty five after","M37":"thirty five after","M38":"twenty to","M39":"twenty to","M40":"twenty to","M41":"twenty to","M42":"twenty to","M43":"twenty to","M44":"a quarter to","M45":"a quarter to","M46":"a quarter to","M47":"a quarter to","M48":"ten to","M49":"ten to","M50":"ten to","M51":"ten to","M52":"ten to","M53":"ten to","M54":"five to","M55":"five to","M56":"five to","M57":"five to","M58":"","M59":"","H01":"one in the morning","H02":"two in the morning","H03":"three in the morning","H04":"four in the morning","H05":"five in the morning","H06":"six in the morning","H07":"seven in the morning","H08":"eight in the morning","H09":"nine in the morning","H10":"ten in the morning","H11":"eleven in the morning","H12":"noon","H13":"one in the afternoon","H14":"two in the afternoon","H15":"three in the afternoon","H16":"four in the afternoon","H17":"five in the afternoon","H18":"six in the evening","H19":"seven in the evening","H20":"eight in the evening","H21":"nine at night","H22":"ten at night","H23":"eleven  at night","H00":"midnight"
Which yields basically what I wanted.
Image

I'm certain this isn't the optimum way of doing this, but I don't know any better at this point, and the end result is satisfactory... however where I run into a problem is when I run over my 35 minute mark each hour, and the hour would ideally increment by one so that it would read "twenty to four" at 3:40 instead of "twenty to three" which is the parse of 3:40 outright. I can't for the life of me figure out how to increment the hour by 1 if the minutes go past 35.

I tried something like this

Code: Select all

[increment]
measure=calc
formula= #minutes# > 35 ? #hours# : (#hours# + 1)
But I couldn't get it to work.

Could anyone give me some guidance as to how I might do this?
Last edited by Iósua on April 16th, 2012, 9:22 pm, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Issue creating Word Clock

Post by jsmorley »

I think the key is a measure something like this that I found in a clock "anelectricQlock by anelectricmind".

Code: Select all

[measureHourAjusted]
Measure=calc
Formula= (measureMinute > 34) ?  ( ((measureHour+1) < 13) ? (measureHour+1) : ( ((measureHour+1) = 24) ? 12 : ((measureHour+1) % 12) ) ) : ( (measureHour > 12) ? (measureHour %12) : (measureHour) )
I can't find the skin available for download anymore, but here is the full code from a copy I have kept around just because it is cool.

Code: Select all

[Rainmeter]
;-------------------------------------------------------------------------------
;  anelectricQlock by anelectricmind.

;    based on and inspired by BIEGERT & FUNK PRODUCT's Qlocktwo.
;    All the credits to them.
;    http://www.qlocktwo.com/
;
;   Version 0.0.2
;      Modified background
;      02.10.2009
;
;   History
;      0.0.1 - 16.09.2009 - Initial English version
;
;  Comments, suggestions or report bugs to anelectricmind@gmail.com
;
;  Copying and modifying of this skin is allowed.  Please give credit where
;  credit is due.
;-------------------------------------------------------------------------------

BackgroundMode=2
SolidColor=0,0,0,128
LocalFont=FUTRFW.TTF

;Metadata added by RainBrowser
;http://rainmeter.net/RainWiki/index.php?title=Rainmeter_101#.5BMetadata.5D

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=#CURRENTPATH#squareclock.png

;End of added Metadata

[Variables]
;Font related variables.
font.name =Futurist Fixed-width
font.size =16
font.color.normal =45, 45, 45, 255
font.color.highlighted =255,255,255,255

;row absolute coordinates
pRow1.y =0
pRow2.y =24
pRow3.y =48
pRow4.y =72
pRow5.y =96
pRow6.y =120
pRow7.y =144
pRow8.y =168
pRow9.y =192
pRow10.y =218

;Numbers absolute coordinates
pIt.x =0
pIs.x =66
pA.x =0
pQuarter.x =44
pTwenty.x =0
pFive1.x =132
pHalf.x =0
pTen.x =110
pTo.x =198
pPast.x =0
pNine.x =154
pOne.x =0
pSix.x =66
pThree.x =132
pFour.x =0
pFive.x =88
pTwo.x =176
pEight.x =0
pEleven.x =109
pSeven.x =0
pTwelve.x =110
pTen2.x =0
pOClock.x =110

[measureHour]
; returns hour
Measure=Time
Format=%H

[measureMinute]
; returns minutes
Measure=Time
Format=%M

[measureHourAjusted]
Measure=calc
Formula= (measureMinute > 34) ?  ( ((measureHour+1) < 13) ? (measureHour+1) : ( ((measureHour+1) = 24) ? 12 : ((measureHour+1) % 12) ) ) : ( (measureHour > 12) ? (measureHour %12) : (measureHour) )

[measureMinuteAjusted]
; adjusts minutes based on the 12 positions of a an analog clock
Measure=calc
Formula=FLOOR((measureMinute > 34)?(ABS((measureMinute+1)-60) / 5)+1:(measureMinute / 5))

;--------------------------------------------------------------------------------
; measures to display the minutes in the hour (5 mins intervals)

[measureMinute_0]
Measure=calc
Formula=FLOOR((measureMinute /5))
IfEqualValue = 0
IfEqualAction=!Execute [!HideMeter MeterPast.highlighted][!HideMeter MeterTo.highlighted][!HideMeter MeterFive1.highlighted][!ShowMeter MeterOClock.highlighted]

[measureMinute_1]
Measure=calc
Formula=measureMinuteAjusted
IfEqualValue = 1
IfEqualAction=!Execute [!HideMeter MeterTen.highlighted][!HideMeter MeterOClock.highlighted][!ShowMeter MeterFive1.highlighted]

[measureMinute_2]
Measure=calc
Formula=measureMinuteAjusted
IfEqualValue = 2
IfEqualAction=!Execute [!HideMeter MeterA.highlighted][!HideMeter MeterQuarter.highlighted][!HideMeter MeterFive1.highlighted][!ShowMeter MeterTen.highlighted]

[measureMinute_3]
Measure=calc
Formula=measureMinuteAjusted
IfEqualValue = 3
IfEqualAction=!Execute [!HideMeter MeterTen.highlighted][!HideMeter MeterTwenty.highlighted][!ShowMeter MeterA.highlighted][!ShowMeter MeterQuarter.highlighted]

[measureMinute_4]
Measure=calc
Formula=measureMinuteAjusted
IfEqualValue = 4
IfEqualAction=!Execute [!HideMeter MeterA.highlighted][!HideMeter MeterFive1.highlighted][!HideMeter MeterQuarter.highlighted][!ShowMeter MeterTwenty.highlighted]

[measureMinute_5]
Measure=calc
Formula=measureMinuteAjusted
IfEqualValue = 5
IfEqualAction=!Execute [!ShowMeter MeterTwenty.highlighted][!ShowMeter MeterFive1.highlighted][!HideMeter MeterHalf.highlighted]

[measureMinute_6]
Measure=calc
Formula=measureMinuteAjusted
IfEqualValue = 6
IfEqualAction=!Execute [!HideMeter MeterTwenty.highlighted][!HideMeter MeterFive1.highlighted][!ShowMeter MeterHalf.highlighted]

;measures to display the hour of the day (12 hour format)
[measureHour_One]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 1
IfEqualAction=!Execute [!HideMeter MeterTwelve.highlighted][!ShowMeter MeterOne.highlighted]

[measureHour_Two]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 2
IfEqualAction=!Execute [!HideMeter MeterOne.highlighted][!ShowMeter MeterTwo.highlighted]

[measureHour_Three]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 3
IfEqualAction=!Execute [!HideMeter MeterTwo.highlighted][!ShowMeter MeterThree.highlighted]

[measureHour_Four]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 4
IfEqualAction=!Execute [!HideMeter MeterThree.highlighted][!ShowMeter MeterFour.highlighted]

[measureHour_Five]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 5
IfEqualAction=!Execute [!HideMeter MeterFour.highlighted][!ShowMeter MeterFive.highlighted]

[measureHour_Six]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 6
IfEqualAction=!Execute [!HideMeter MeterFive.highlighted][!ShowMeter MeterSix.highlighted]

[measureHour_Seven]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 7
IfEqualAction=!Execute [!HideMeter MeterSix.highlighted][!ShowMeter MeterSeven.highlighted]

[measureHour_Eight]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 8
IfEqualAction=!Execute [!HideMeter MeterSeven.highlighted][!ShowMeter MeterEight.highlighted]

[measureHour_Nine]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 9
IfEqualAction=!Execute [!HideMeter MeterEight.highlighted][!ShowMeter MeterNine.highlighted]

[measureHour_Ten]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 10
IfEqualAction=!Execute [!HideMeter MeterNine.highlighted][!ShowMeter MeterTen2.highlighted]

[measureHour_Eleven]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 11
IfEqualAction=!Execute [!HideMeter MeterTen.highlighted][!ShowMeter MeterEleven.highlighted]

[measureHour_Twelve]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 12
IfEqualAction=!Execute [!HideMeter MeterEleven.highlighted][!ShowMeter MeterTwelve.highlighted]

[measurePastTo]
Measure=calc
Formula= FLOOR(measureMinute /5)
IfAboveValue=0
IfAboveAction=!Execute [!ShowMeter MeterPast.highlighted][!HideMeter MeterOClock.highlighted][!HideMeter MeterTo.highlighted]

[measurePastTo2]
Measure=calc
Formula= FLOOR(measureMinute /5)
IfAboveValue=6
IfAboveAction=!Execute [!ShowMeter MeterTo.highlighted][!HideMeter MeterOClock.highlighted][!HideMeter MeterPast.highlighted]

-------------------------------------METERS--------------------------------------------

[MeterBackgroundRow1]
Meter=STRING
X=0
Y=#pRow1.y
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="ITAISNETIME"
AntiAlias=1

[MeterBackgroundRow2]
Meter=STRING
X=0
Y=#pRow2.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="ALQUARTEREC"
AntiAlias=1

[MeterBackgroundRow3]
Meter=STRING
X=0
Y=#pRow3.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="TWENTYFIVET"
AntiAlias=1

[MeterBackgroundRow4]
Meter=STRING
X=0
Y=#pRow4.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="HALFRTENITO"
AntiAlias=1

[MeterBackgroundRow5]
Meter=STRING
X=0
Y=#pRow5.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="PASTCMININE"
AntiAlias=1

[MeterBackgroundRow6]
Meter=STRING
X=0
Y=#pRow6.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="ONESIXTHREE"
AntiAlias=1

[MeterBackgroundRow7]
Meter=STRING
X=0
Y=#pRow7.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="FOURFIVETWO"
AntiAlias=1

[MeterBackgroundRow8]
Meter=STRING
X=0
Y=#pRow8.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="EIGHTELEVEN"
AntiAlias=1

[MeterBackgroundRow9]
Meter=STRING
X=0
Y=#pRow9.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="SEVENTWELVE"
AntiAlias=1

[MeterBackgroundRow10]
Meter=STRING
X=0
Y=#pRow10.y#
FontColor=#font.color.normal#
FontSize=#font.size#
FontFace=#font.name#
Text="TENNDOCLOCK"
AntiAlias=1
            
            
[MeterIt]
Meter=STRING
X=#pIt.x#
Y=#pRow1.y
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="IT"
AntiAlias=1


[MeterIs]
Meter=STRING
X=#pIs.x#
Y=#pRow1.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="IS"
AntiAlias=1
Hidden=0

------------------------------------------------------------------------------------
;highlighted numbers

[MeterA.highlighted]
Meter=STRING
X=#pA.x#
Y=#pRow2.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="A"
AntiAlias=1
Hidden=1


[MeterQuarter.highlighted]
Meter=STRING
X=#pQuarter.x#
Y=#pRow2.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="QUARTER"
AntiAlias=1
Hidden=1


[MeterTwenty.highlighted]
Meter=STRING
X=#pTwenty.x#
Y=#pRow3.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="TWENTY"
AntiAlias=1
hidden=1

[MeterFive1.highlighted]
Meter=STRING
X=#pFive1.x#
Y=#pRow3.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="FIVE"
AntiAlias=1
hidden=1

[MeterHalf.highlighted]
Meter=STRING
X=#pHalf.x#
Y=#pRow4.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="HALF"
AntiAlias=1
Hidden=1


[MeterTen.highlighted]
Meter=STRING
X=#pTen.x#
Y=#pRow4.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="TEN"
AntiAlias=1
Hidden=1


[MeterTo.highlighted]
Meter=STRING
X=#pTo.x#
Y=#pRow4.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="TO"
AntiAlias=1
Hidden=1


[MeterPast.highlighted]
Meter=STRING
X=#pPast.x#
Y=#pRow5.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="PAST"
AntiAlias=1
Hidden=1


[MeterNine.highlighted]
Meter=STRING
X=#pNine.x#
Y=#pRow5.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="NINE"
AntiAlias=1
Hidden=1


[MeterOne.highlighted]
Meter=STRING
X=#pOne.x#
Y=#pRow6.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="ONE"
AntiAlias=1
Hidden=1


[MeterSix.highlighted]
Meter=STRING
X=#pSix.x#
Y=#pRow6.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="SIX"
AntiAlias=1
Hidden=1


[MeterThree.highlighted]
Meter=STRING
X=#pThree.x#
Y=#pRow6.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="THREE"
AntiAlias=1
Hidden=1


[MeterFour.highlighted]
Meter=STRING
X=#pFour.x#
Y=#pRow7.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="FOUR"
AntiAlias=1
Hidden=1


[MeterFive.highlighted]
Meter=STRING
X=#pFive.x#
Y=#pRow7.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="FIVE"
AntiAlias=1
Hidden=1


[MeterTwo.highlighted]
Meter=STRING
X=#pTwo.x#
Y=#pRow7.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="TWO"
AntiAlias=1
Hidden=1


[MeterEight.highlighted]
Meter=STRING
X=#pEight.x#
Y=#pRow8.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="EIGHT"
AntiAlias=1
Hidden=1


[MeterEleven.highlighted]
Meter=STRING
X=#pEleven.x#
Y=#pRow8.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="ELEVEN"
AntiAlias=1
Hidden=1


[MeterSeven.highlighted]
Meter=STRING
X=#pSeven.y#
Y=#pRow9.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="SEVEN"
AntiAlias=1
Hidden=1


[MeterTwelve.highlighted]
Meter=STRING
X=#pTwelve.x#
Y=#pRow9.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="TWELVE"
AntiAlias=1
Hidden=1


[MeterTen2.highlighted]
Meter=STRING
X=#pTen2.x#
Y=#pRow10.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="TEN"
AntiAlias=1
Hidden=1


[MeterOClock.highlighted]
Meter=STRING
X=#pOClock.x#
Y=#pRow10.y#
FontColor=#font.color.highlighted#
FontSize=#font.size#
FontFace=#font.name#
Text="OCLOCK"
AntiAlias=1
Hidden=1
Iósua
Posts: 2
Joined: April 16th, 2012, 6:23 pm

Re: Issue creating Word Clock

Post by Iósua »

You have my sincere thanks, as after a bit of tinkering, that formula appeared to have done the trick. I'll post the successful code here for anyone else who may wish to do something similar. I haven't tested it for every time to make sure there are no mistakes, but it appears to transition from minutes to/minutes after properly.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[measureHour]
Measure=Time
Format=%H

[measureMinute]
Measure=Time
Format=%M
Substitute="00":"","01":"","02":"","03":"five after","04":"five after","05":"five after","06":"five after","07":"five after","08":"ten after","09":"ten after","10":"ten after","11":"ten after","12":"ten after","13":"a quarter after","14":"a quarter after","15":"a quarter after","16":"a quarter after","17":"a quarter after","18":"twenty after","19":"a quarter after","20":"a quarter after","21":"a quarter after","22":"a quarter after","23":"twenty-five after","24":"twenty-five after","25":"twenty-five after","26":"twenty-five after","27":"twenty-five after","28":"half past","29":"half past","30":"half past","31":"half past","32":"half past","33":"half past","34":"thirty five after","35":"thirty five after","36":"thirty five after","37":"thirty five after","38":"twenty to","39":"twenty to","40":"twenty to","41":"twenty to","42":"twenty to","43":"twenty to","44":"a quarter to","45":"a quarter to","46":"a quarter to","47":"a quarter to","48":"ten to","49":"ten to","50":"ten to","51":"ten to","52":"ten to","53":"ten to","54":"five to","55":"five to","56":"five to","57":"five to","58":"","59":""

[measureHourAjusted]
Measure=calc
Formula= (measureMinute > 34) ? (measureHour+1) : (measureHour+0)
Substitute="01":"one","02":"two","03":"three","04":"four","05":"five","06":"six","07":"seven","08":"eight","09":"nine","10":"ten","11":"eleven","12":"","13":"one","14":"two","15":"three","16":"four","17":"five","18":"six","19":"seven","20":"eight","21":"nine","22":"ten","23":"eleven","24":""

[measureLight]
Measure=Time
Format=%H.
Substitute="01":"in the morning","02":"in the morning","03":"in the morning","04":"in the morning","05":"in the morning","06":"in the morning","07":"in the morning","08":"in the morning","09":"in the morning","10":"in the morning","11":"in the morning","12":"noon","13":"in the afternoon","14":"in the afternoon","15":"in the afternoon","16":"in the afternoon","17":"in the afternoon","18":"in the evening","19":"in the evening","20":"in the evening","21":"at night","22":"at night","23":"at night","00":"midnight"

[MeterTime]
Meter=String
Prefix="It is "
MeasureName=measureMinute
x=0
y=0
SolidColor=0,0,0,1
FontColor=78,70,63,255
FontSize=30
FontFace=Centurion
AntiAlias=1

[MeterTime2]
Meter=String
MeasureName=measureHourAjusted
x=0R
y=0
SolidColor=0,0,0,1
FontColor=78,70,63,255
FontSize=30
FontFace=Centurion
AntiAlias=1

[MeterTime3]
Meter=String
MeasureName=measureLight
x=0R
y=0
SolidColor=0,0,0,1
FontColor=78,70,63,255
FontSize=30
FontFace=Centurion
AntiAlias=1
Again, my thanks to you sir!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: (Solved)Issue creating Word Clock

Post by jsmorley »

Glad to help. Are you accounting for when it is twenty five to one? In other words when the hour is 12 or 23, you don't want to add 1 without testing that it doesn't return 13 or 24. (didn't look to see if you are doing 12 or 24 hour time)
d4l3d
Posts: 1
Joined: April 12th, 2009, 8:29 pm

Re: (Solved)Issue creating Word Clock

Post by d4l3d »

Sorry to reanimate an older thread but I don't believe this has been completely resolved and I'm too inexperienced.
Found this thread a few days ago and have been trying to make the final solution work ever since.

Mostly it does except:
I have found that with hours, if I leave things as they are, 10-23 (BTW, 00 is midnight) displays as words and 00-09 as digits.
If I drop the 0s from 00-09, the reverse is true.

I've tried several simple mods (splits and variations between %H-%I among others) without any results.
Has anyone pursued this further? This has the potential of being all I'd want in a clock display.
User avatar
maxthegold
Posts: 19
Joined: February 11th, 2012, 6:18 am
Location: Kiama, NSW, Australia

Re: (Solved)Issue creating Word Clock

Post by maxthegold »

This was annoying me as well, but I think I have cracked it. I have zero suppression in the Measure and moved the single digit substitution to the end of the statement to avoid substituting the individual digits of double digit times. Here are the relevant bits of code.....

Code: Select all

[measureHour]
Measure=Time
Format=%#H

[measureMinute]
Measure=Time
Format=%M
Substitute="00":"","01":"","02":"","03":"five past","04":"five past","05":"five past","06":"five past","07":"five past","08":"ten past","09":"ten past","10":"ten past","11":"ten past","12":"ten past","13":"a quarter past","14":"a quarter past","15":"a quarter past","16":"a quarter past","17":"a quarter past","18":"twenty past","19":"twenty past","20":"twenty past","21":"twenty past","22":"twenty past","23":"twenty five past","24":"twenty five past","25":"twenty five past","26":"twenty five past","27":"twenty five past","28":"half past","29":"half past","30":"half past","31":"half past","32":"half past","33":"half past","34":"twenty five to","35":"twenty five to","36":"twenty five to","37":"twenty five to","38":"twenty to","39":"twenty to","40":"twenty to","41":"twenty to","42":"twenty to","43":"twenty to","44":"a quarter to","45":"a quarter to","46":"a quarter to","47":"a quarter to","48":"ten to","49":"ten to","50":"ten to","51":"ten to","52":"ten to","53":"ten to","54":"five to","55":"five to","56":"five to","57":"five to","58":"","59":""

[measureHourAjusted]
Measure=Calc
Formula= (measureMinute > 33) ? (measureHour+1) : (measureHour+0)
Substitute="10":"ten","11":"eleven","12":"twelve","13":"one","14":"two","15":"three","16":"four","17":"five","18":"six","19":"seven","20":"eight","21":"nine","22":"ten","23":"eleven","24":"twelve","0":"","1":"one","2":"two","3":"three","4":"four","5":"five","6":"six","7":"seven","8":"eight","9":"nine"

[measureLight]
Measure=Calc
Formula= (measureMinute > 33) ? (measureHour+1) : (measureHour+0)
Substitute="10":"in the morning","11":"in the morning","12":"noon","13":"in the afternoon","14":"in the afternoon","15":"in the afternoon","16":"in the afternoon","17":"in the afternoon","18":"in the evening","19":"in the evening","20":"in the evening","21":"at night","22":"at night","23":"at night","24":"midnight","0":"midnight","1":"in the morning","2":"in the morning","3":"in the morning","4":"in the morning","5":"in the morning","6":"in the morning","7":"in the morning","8":"in the morning","9":"in the morning"