[Rainmeter]
Author=Smurfier
Update=1000
DynamicWindowSize=1

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=
Preview=

[Variables]
@include=Settings.inc

[mBack]
Meter=Image
SolidColor=#BgColor#
H=#SHeight#
W=#CURRENTCONFIGWIDTH#
DynamicVariables=1

[TextStyle]
FontFace=Arial
FontSize=10
FontColor=#MainText#
AntiAlias=1
H=16
W=16
Y=[cSpace]r
X=(#TextX#+((#Indicator#<3)*5))
DynamicVariables=1

[mYear]
;Retreve year with century
Measure=TIME
Format=%Y

[mMonth]
;Gets current month without leading zero. ex: 8
Measure=TIME
Format=%#m

[mDay]
;Gets current day without leading zero. ex 8
Measure=TIME
Format=%#d

[cCentury]
;mod(century,4)
Measure=CALC
Formula=TRUNC(mYear/100)%4

[cYear]
;separate year from century
measure=CALC
Formula=FRAC(mYear/100)*100

[cMonthStartDay]
;Determines which day of the week a month starts.
Measure=CALC
Formula=(FLOOR((5*cYear)/4)+(((mMonth=3)||(mMonth=11)||(mMonth=2))*3+((mMonth=4)||(mMonth=7))*6+(mMonth=5)+(mMonth=6)*4+(mMonth=8)*2+((mMonth=9)||(mMonth=12))*5+((cYear%4=0)&&(cYear%100<>0)||(cYear%400=0))*(mMonth=1?6:2))+1-(2*cCentury))%7

[cMonthStart]
;Used to help determine day a month starts. If the day of the week is 0 or Saturday then return 7 (for day 7 in a traditional sense) otherwise return the other "coded" day of the week.
Measure=CALC
Formula=8-(cMonthStartDay=0?7:cMonthStartDay)

[mDayCount]
Measure=CALC
Formula=((mMonth=1)||(mMonth=12)||(mMonth=8)||(mMonth=7)||(mMonth=5)||(mMonth=3)||(mMonth=10))*31+(mMonth=2)*(28+((mYear%4)=0))+((mMonth=4)||(mMonth=6)||(mMonth=9)||(mMonth=11))*30

[cSpace]
Measure=Calc
Formula=FLOOR(#SHeight#/mDayCount)

[cCenter]
Measure=Calc
Formula=FLOOR(#SHeight#-(cSpace*mDayCount))/2*#Center#

[WeekStyle]
H=1
W=#CURRENTCONFIGWIDTH#
SolidColor=255,255,255,255
DynamicVariables=1
Hidden=#WIndic#

[cLW]
Measure=Calc
Formula=CEIL(((cMonthStartDay=0?7:cMonthStartDay)-1+mDayCount)/7)<6
Disabled=#WIndic#

[mWeek1]
Meter=Image
MeterStyle=WeekStyle
Y=([cCenter]+#IndicatorHeight#/2+[cSpace]*([cMonthStart]-0.5))

[mWeek2]
Meter=Image
MeterStyle=WeekStyle
Y=([cCenter]+[cSpace]*([cMonthStart]+6.5)+#IndicatorHeight#/2)

[mWeek3]
Meter=Image
MeterStyle=WeekStyle
Y=([cCenter]+[cSpace]*([cMonthStart]+13.5)+#IndicatorHeight#/2)

[mWeek4]
Meter=Image
MeterStyle=WeekStyle
Y=([cCenter]+[cSpace]*([cMonthStart]+20.5)+#IndicatorHeight#/2)

[mWeek5]
Meter=Image
MeterStyle=WeekStyle
Y=([cCenter]+[cSpace]*([cMonthStart]+27.5)+#IndicatorHeight#/2)
Hidden=[cLW]

[cDay1]
Meter=String
MeterStyle=TextStyle
Text="01"
Y=(#IndicatorHeight#/2+[cCenter]-8)

[cDay2]
Meter=String
MeterStyle=TextStyle
Text="02"

[cDay3]
Meter=String
MeterStyle=TextStyle
Text="03"

[cDay4]
Meter=String
MeterStyle=TextStyle
Text="04"

[cDay5]
Meter=String
MeterStyle=TextStyle
Text="05"

[cDay6]
Meter=String
MeterStyle=TextStyle
Text="06"

[cDay7]
Meter=String
MeterStyle=TextStyle
Text="07"

[cDay8]
Meter=String
MeterStyle=TextStyle
Text="08"

[cDay9]
Meter=String
MeterStyle=TextStyle
Text="09"

[cDay10]
Meter=String
MeterStyle=TextStyle
Text="10"

[cDay11]
Meter=String
MeterStyle=TextStyle
Text="11"

[cDay12]
Meter=String
MeterStyle=TextStyle
Text="12"

[cDay13]
Meter=String
MeterStyle=TextStyle
Text="13"

[cDay14]
Meter=String
MeterStyle=TextStyle
Text="14"

[cDay15]
Meter=String
MeterStyle=TextStyle
Text="15"

[cDay16]
Meter=String
MeterStyle=TextStyle
Text="16"

[cDay17]
Meter=String
MeterStyle=TextStyle
Text="17"

[cDay18]
Meter=String
MeterStyle=TextStyle
Text="18"

[cDay19]
Meter=String
MeterStyle=TextStyle
Text="19"

[cDay20]
Meter=String
MeterStyle=TextStyle
Text="20"

[cDay21]
Meter=String
MeterStyle=TextStyle
Text="21"

[cDay22]
Meter=String
MeterStyle=TextStyle
Text="22"

[cDay23]
Meter=String
MeterStyle=TextStyle
Text="23"

[cDay24]
Meter=String
MeterStyle=TextStyle
Text="24"

[cDay25]
Meter=String
MeterStyle=TextStyle
Text="25"

[cDay26]
Meter=String
MeterStyle=TextStyle
Text="26"

[cDay27]
Meter=String
MeterStyle=TextStyle
Text="27"

[cDay28]
Meter=String
MeterStyle=TextStyle
Text="28"

[cHide29]
Measure=Calc
Formula=mDayCount<29

[cDay29]
Meter=String
MeterStyle=TextStyle
Text="29"
Hidden=[cHide29]
Y=(([cHide29]=0)*[cSpace])r

[cHide30]
Measure=Calc
Formula=mDayCount<30

[cDay30]
Meter=String
MeterStyle=TextStyle
Text="30"
Hidden=[cHide30]
Y=(([cHide30]=0)*[cSpace])r

[cHide31]
Measure=Calc
Formula=mDayCount<31

[cDay31]
Meter=String
MeterStyle=TextStyle
Text="31"
Hidden=[cHide31]
Y=(([cHide31]=0)*[cSpace])r

[cQuarterRound]
Measure=Calc
Formula=0.25

[mIndicator]
Meter=Image
SolidColor=#IndicatorColorTop#
SolidColor2=#IndicatorColorBot#
GradientAngle=90
H=((#IndicatorHeight#-10)<0?0:#IndicatorHeight#-10)
W=((#IndicatorWidth#-10)<0?0:#IndicatorWidth#-10)
Y=(([cSpace]*([mDay]-1))+[cCenter]+5)
X=((#Indicator#<>3)*5)
DynamicVariables=1

[cLftHid]
Measure=Calc
Formula=#Indicator#=3
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterHideMeterGroup Left][!RainmeterRedraw]

[cRghHid]
Measure=Calc
Formula=#Indicator#=2
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterHideMeterGroup Right][!RainmeterRedraw]

[mTopBox]
Meter=Image
SolidColor=#IndicatorColorTop#
H=5
W=((#IndicatorWidth#-10)<0?0:#IndicatorWidth#-(#Indicator#=2?10:9))
Y=(([cSpace]*([mDay]-1))+[cCenter])
X=((#Indicator#<>3)*5)
DynamicVariables=1

[mBotBox]
Meter=Image
SolidColor=#IndicatorColorBot#
H=5
W=((#IndicatorWidth#-10)<0?0:#IndicatorWidth#-10)
Y=(([cSpace]*([mDay]-1))+[cCenter]+#IndicatorHeight#-5)
X=((#Indicator#<>3)*5)
DynamicVariables=1

[mLefBox]
Meter=Image
SolidColor=#IndicatorColorTop#
SolidColor2=#IndicatorColorBot#
GradientAngle=90
H=((#IndicatorHeight#-10)<0?0:#IndicatorHeight#-9)
W=5
Y=(([cSpace]*([mDay]-1))+[cCenter]+5)
X=0
DynamicVariables=1
Group=Left

[mRghBox]
Meter=Image
SolidColor=#IndicatorColorTop#
SolidColor2=#IndicatorColorBot#
GradientAngle=90
H=((#IndicatorHeight#-10)<0?0:#IndicatorHeight#-10)
W=5
Y=(([cSpace]*([mDay]-1))+[cCenter]+5)
X=(#IndicatorWidth#-(#Indicator#=3?10:5))
DynamicVariables=1
Group=Right

[RoundStyle]
MeasureName=cQuarterRound
LineLength=5
H=10
W=10
Solid=1
AntiAlias=1
DynamicVariables=1

[mTopLftR]
Meter=Roundline
MeterStyle=RoundStyle
LineColor=#IndicatorColorTop#
Y=(([cSpace]*([mDay]-1))+[cCenter])
StartAngle=3.1415
Group=Left

[mBotLftR]
Meter=Roundline
MeterStyle=RoundStyle
LineColor=#IndicatorColorBot#
Y=(([cSpace]*([mDay]-1))+[cCenter]+#IndicatorHeight#-10)
StartAngle=1.57
Group=Left

[mTopRghR]
Meter=Roundline
MeterStyle=RoundStyle
LineColor=#IndicatorColorTop#
Y=(([cSpace]*([mDay]-1))+[cCenter])
X=(#IndicatorWidth#-(#Indicator#=3?15:10))
StartAngle=-1.57
Group=Right

[mBotRghR]
Meter=Roundline
MeterStyle=RoundStyle
LineColor=#IndicatorColorBot#
Y=(([cSpace]*([mDay]-1))+[cCenter]+#IndicatorHeight#-10)
X=(#IndicatorWidth#-(#Indicator#=3?15:10))
Group=Right

[cDay]
Measure=Calc
Formula=mDay/100
Substitute="0.":""

[mCurrent]
Meter=String
MeterStyle=TextStyle
MeasureName=cDay
NumOfDecimals=2
Y=(([cSpace]*([mDay]-1))+[cCenter]+5)
FontColor=#CurrentText#