It is currently November 29th, 2021, 11:36 am

Date Calculator

Clocks and timer skins
User avatar
cadr10
Posts: 24
Joined: January 22nd, 2015, 5:12 am
Location: Brazil

Date Calculator

Post by cadr10 »

Made a skin based on this website

Image

Code: Select all

[Rainmeter]
Update=1000
dynamicwindowsize=1
BackgroundMode=2
SolidColor=0,0,0,120

[Variables]
fontcolor=255,0,0



years=0
months=0
weeks=0
days=0
Signal=+
leapyear=0

[LeapYear]
Measure=CALC
Formula=(FRAC(Result / 4))
IfCondition=Leapyear = 0
;IfTrueAction=[!SetVariable leapyear 86400]
;IfFalseAction=[!SetVariable leapyear 0]


[Today]
Measure=Time
[Result]
Measure=Time
Format=%d/%m/%Y
Timestamp=([Today:]#signal#[msyearcalc:]#signal#[msmonthcalc:]#signal#[msweekscalc:]#signal#[msdayscalc:])
IfMatch=#years# = Years
IfMatchAction=[!SetVariable years 0]
IfMatch2=#months# = Months
IfMatchAction2=[!SetVariable months 0]
IfMatch3=#weeks# = Weeks
IfMatchAction3=[!SetVariable weeks 0]
IfMatch4=#days# = Days
IfMatchAction4=[!SetVariable days 0]
DynamicVariables=1
[msyearcalc]
Measure=Calc
Formula=#years# * 31556926
DynamicVariables=1
[msmonthcalc]
Measure=Calc
Formula=#months# * 2629743.83
DynamicVariables=1
[msweekscalc]
Measure=calc
Formula=#weeks# * 604800
DynamicVariables=1
[msdayscalc]
measure=calc
Formula=#days# * 86400
DynamicVariables=1


[MeasureInput]
Measure=Plugin
Plugin=InputText
SolidColor=255,255,255
FontColor=0,0,0
FontFace=Seqoe UI
StringStyle=Italic
FontSize=9
X=1
Y=30
H=16
W=163
Command1=!SetVariable years "$UserInput$" DefaultValue="Years"
Command2=!SetVariable months "$UserInput$" DefaultValue="Months"
Command3=!SetVariable weeks "$UserInput$" DefaultValue="Weeks"
Command4=!SetVariable days "$UserInput$" DefaultValue="Days"
Command5=!SetOption Result1 Text %1

[Result1]
meter=string
fontcolor=#fontColor#
fontsize=15
antialias=1
stringstyle=bold
measurename=result
Text=Date Calculator
X=(([add:w]+[subtract:w])/1.93)
StringAlign=center
SolidColor=0,0,0,1
dynamicvariables=1
LeftMouseUpAction=[!SetOption Result1 Text "Date Calculator"][!Refresh]

[Add]
Meter=String
FontColor=#fontColor#
FontFace=Seqoe UI
FontSize=13
Text=(+) Add
SolidColor=0,0,0,1
Y=R
LeftMouseUpAction=[!SetVariable signal "+"][!CommandMeasure "MeasureInput" "ExecuteBatch 1-5"]
AntiAlias=1
dynamicvariables=1

[Subtract]
Meter=String
MeterStyle=Add
Text=(-) Subtract
X=5R
Y=r
LeftMouseUpAction=[!SetVariable signal "-"][!CommandMeasure "MeasureInput" "ExecuteBatch 1-5"]