It is currently September 16th, 2019, 11:46 am

Assistance with Calculating Term End Dates

Help with creating, editing & fixing problems with skins
Craash
Posts: 27
Joined: October 17th, 2017, 4:37 pm

Assistance with Calculating Term End Dates

Craash » May 17th, 2019, 4:12 pm

I'm a professor at a university, and I use rainmeter for a ton of stuff. Lots of SNMP monitoring of other devices, along with hwifno, plex, etc.

I"m trying to come up with a skin that will show me the following information on student terms: There would be 5 lines, the current term, and the previous 5 terms.


| Current Term (First of Current Month | Term End (Current + 6 MO) | Weeks Left (Term End - Current Month in Weeks) | Critical Action (Current Month +45 - Today)

I'm hoping for the previous 5 terms as line items too, (First Day of current month -1 Month), (First Day of current month -2 Month), etc.

Obviously, i some instances it will roll to the previous year.

I can calculate the previous term start dates, back until it rolls to the previous year, but I'm really not sure how to calculate the other stuff I want. Any ideas?

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=255,0,0,0
;*****************************
SkinWidth=171
SkinHeight=200
ContextTitle=Open @Includes Folder
ContextAction=["#@#"]
ContextTitle2=---
ContextAction2=[]
ContextTitle3=More Actions...
ContextAction3=[!SkinMenu]
RightMouseUpAction=!SkinCustomMenu


[Variables]
; Font Variables
TextFont=Fira Sans
MonoFont=Fira Mono

; Color Variables
LabelColor=208,224,247
ValueColor=247,252,255,255
BarBackColor=#LabelColor#,75
BackgroundAlpha=200
BackgroundColor=0,0,0,#BackgroundAlpha#
BackHeight=200

[MeterAllBackground]
Meter=Image
W=170
;H=100
#H=160
SolidColor=0,0,0,1

[MeterNetBackground]
Meter=Shape
;Shape=Rectangle 1,1,169,103,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
Shape=Rectangle 1,1,169,160,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
;X=(#NetOffSet#)
W=171
;H=103
H=165
UpdateDivider=-1
DynamicVariables=1

[mMonth]
Measure			=time
Format			=%#m

[Month-1]
Measure			=calc
Formula			=mMonth - 1

[Month-2]
Measure			=calc
Formula			=mMonth - 2
[Month-3]
Measure			=calc
Formula			=mMonth - 3
[Month-4]
Measure			=calc
Formula			=mMonth - 4
[Month-5]
Measure			=calc
Formula			=mMonth - 5
[Meter CurrentMonth]
Meter=String
MeasureName=mMonth
X=5
Y=5
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | 10
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/19

[Meter MeasureMonth-1]
Meter=String
MeasureName=Month-1
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | 10
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/19

[Meter MeasureMonth-2]
Meter=String
MeasureName=Month-2
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | 10
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/19
[Meter MeasureMonth-3]
Meter=String
MeasureName=Month-3
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | 10
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/19
[Meter MeasureMonth-4]
Meter=String
MeasureName=Month-4
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | 10
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/19
[Meter MeasureMonth-5]
Meter=String
MeasureName=Month-5
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | 10
InlineSetting3=Color | #ValueColor#,255
Text=([Month-5] = 0 ? 12 : [Month-5])
AntiAlias=1
DynamicVariables=1
Last edited by eclectic-tech on May 21st, 2019, 12:22 am, edited 1 time in total.
Reason: Please use code tags. It is the </> symbol.
User avatar
SilverAzide
Posts: 573
Joined: March 23rd, 2015, 5:26 pm

Re: Assistance with Calculating Term End Dates

SilverAzide » May 17th, 2019, 8:31 pm

I think you need to clarify what you are trying to do. Your approach of using the "current month" and a time measure doesn't seem like a workable plan. By using "current month", you are going to create a sliding "window" of time, where you will never reach the "term end" date, because it is always 6 months from "now". The other milestones will also never be reached for the same reason.

You need to put a stake in the sand and select the start; once you do that, all other milestone dates can be easily calculated.
DeviantArt Gadgets More...
Craash
Posts: 27
Joined: October 17th, 2017, 4:37 pm

Re: Assistance with Calculating Term End Dates

Craash » May 18th, 2019, 6:50 pm

SilverAzide wrote:
May 17th, 2019, 8:31 pm
I think you need to clarify what you are trying to do. Your approach of using the "current month" and a time measure doesn't seem like a workable plan. By using "current month", you are going to create a sliding "window" of time, where you will never reach the "term end" date, because it is always 6 months from "now". The other milestones will also never be reached for the same reason.

You need to put a stake in the sand and select the start; once you do that, all other milestone dates can be easily calculated.
It IS a rolling windows. We have terms start each month, I want to to know how many weeks are left in the term, along with once 45 days have passed for each term. The 'stake in the sand' is the 1st of the current month.

Each month, the term that is 5 months old will fall off and a new one will start.


This would be for "now" (5.181.19). I didn't do that actual match, just made it close. Next month, 12.1.18 would roll off (because the term is over) and 6.1.19 would be added.

Term Start____ Weeks Left___ Critical Action
12.1.18_________ 2__________Past
1.1.19__________ 6__________Past
2.1.19__________10 _________Past
3.1.19__________14__________Past
4.1.19__________18__________2 days
5.1.19__________22__________30 days

The entire concept is when I speak with a student, I can tell at a glance how many weeks are left in his current term.


John, your term started 2.1.19 - you have 10 weeks left, yet you still have 8 credits to finish.

Mike, your term started 4.1.19, you have 3 days left to finish the critical action (first test).
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3537
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Assistance with Calculating Term End Dates

eclectic-tech » May 21st, 2019, 3:47 am

Here is a start to your project. [mTime] returns the timestamp for the current day.
On the first day of a month, the skin will set Term1End and Term1Critical variables.
Those values are used to calculate the remaning weeks and days for all terms as time passes.

I have not fully tested, but this should get you at least a starting point.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=255,0,0,0
;*****************************
SkinWidth=341
SkinHeight=200
ContextTitle=Open @Includes Folder
ContextAction=["#@#"]
ContextTitle2=---
ContextAction2=[]
ContextTitle3=More Actions...
ContextAction3=[!SkinMenu]
RightMouseUpAction=!SkinCustomMenu


[Variables]
; Font Variables
TextFont=Fira Sans
MonoFont=Fira Mono
TextSize=12

; Color Variables
LabelColor=208,224,247
ValueColor=247,252,255,255
BarBackColor=#LabelColor#,75
BackgroundAlpha=200
BackgroundColor=0,0,0,#BackgroundAlpha#
; Positioning
Tab0=5
Tab1=100
Tab2=200

Term1Critical=13204938054
Term1End=13216382871
‬
; ============== Measures ==============
; =====================================

[mTime]
Measure=Time

[mYear]
Measure=Time
Format=%#y

[mPreviousYear]
Measure=Calc
Formula=mYear-1

[mMonth]
Measure=Time
Format=%#m

[PreviousMonth1]
Measure=calc
Formula=((mMonth - 1 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth1 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth1 MeasureName2 "mYear"]

[PreviousMonth2]
Measure=calc
Formula=((mMonth - 2 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth2 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth2 MeasureName2 "mYear"]

[PreviousMonth3]
Measure=calc
Formula=((mMonth - 3 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth3 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth3 MeasureName2 "mYear"]

[PreviousMonth4]
Measure=calc
Formula=((mMonth - 4 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth4 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth4 MeasureName2 "mYear"]

[PreviousMonth5]
Measure=calc
Formula=((mMonth - 5 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth5 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth5 MeasureName2 "mYear"]

[mDay]
Measure=Time
Format=%#d
; Actions to create a new term, delete oldest term and set 45 day point
IfCondition=(#CurrentSection#=1)
IfTrueAction=[!EnableMeasureGroup NewTerm][!UpdateMeasureGroup NewTerm][!DisableMeasureGroup NewTerm]

[mTerm1Plus45Days]
Group=NewTerm
Measure=Calc
Formula=mTime + (45 * 86400)
OnUpdateAction=[!SetVariable Term1Critical [mTerm1Plus45Days]][!WriteKeyValue Variables Term1Critical [mTerm1Plus45Days]]
Disabled=1

[mTerm1CriticalDaysRemaining]
Measure=Calc
Formula=Round((#Term1Critical# - mTime)/86400)

[mPreviousTermCritical]
Measure=Calc
Formula=Clamp(mTerm1CriticalDaysRemaining - 30,0,15)
DynamicVariables=1

[mTerm1End]
Group=NewTerm
Measure=Calc
Formula=mTime + 24 * 604800
OnUpdateAction=[!SetVariable Term1End [mTerm1End]][!WriteKeyValue Variables Term1End [mTerm1End]]
Disabled=1

[mTerm1WeeksRemaining]
Measure=Calc
Formula=Round((#Term1End# - mTime)/604800)

[mTerm2WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 4,0,22)

[mTerm3WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 8,0,22)

[mTerm4WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 12,0,22)

[mTerm5WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 16,0,22)

[mTerm6WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 20,0,22)


; Meters
; =====================================

[MeterNetBackground]
Meter=Shape
;Shape=Rectangle 1,1,169,103,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
Shape=Rectangle 1,1,310,150,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
;X=(#NetOffSet#)
UpdateDivider=-1
DynamicVariables=1

;Term Start____ Weeks Left___ Critical Action
[MeterTitle1]
Meter=String
X=#Tab0#
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=Term Start

[MeterTitle2]
Meter=String
X=#Tab1#
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=Weeks Left

[MeterTitle3]
Meter=String
X=#Tab2#
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=Critical Action

[MeterPreviousMonth5]
Meter=String
MeasureName=PreviousMonth5
MeasureName2=mYear
X=#Tab0#
Y=20r
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1/1/%2
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth5WeeksLeft]
Meter=String
MeasureName=mTerm6WeeksRemaining
X=(#Tab1#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth5Critical]
Meter=String
X=(#Tab2#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth4]
Meter=String
MeasureName=PreviousMonth4
MeasureName2=mYear
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth4WeeksLeft]
Meter=String
MeasureName=mTerm5WeeksRemaining
X=(#Tab1#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth4Critical]
Meter=String
X=(#Tab2#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth3]
Meter=String
MeasureName=PreviousMonth3
MeasureName2=mYear
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth3WeeksLeft]
Meter=String
MeasureName=mTerm4WeeksRemaining
X=(#Tab1#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth3Critical]
Meter=String
X=(#Tab2#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth2]
Meter=String
MeasureName=PreviousMonth2
MeasureName2=mYear
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth2WeeksLeft]
Meter=String
MeasureName=mTerm3WeeksRemaining
X=(#Tab1#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth2Critical]
Meter=String
X=(#Tab2#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth1]
Meter=String
MeasureName=PreviousMonth1
MeasureName2=mYear
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth1WeeksLeft]
Meter=String
MeasureName=mTerm2WeeksRemaining
X=(#Tab1#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth1Critical]
Meter=String
MeasureName=mPreviousTermCritical
X=(#Tab2#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterCurrentMonth]
Meter=String
MeasureName=mMonth
MeasureName2=mYear
X=5
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterCurrentMonthWeeksRemaining]
Meter=String
MeasureName=mTerm1WeeksRemaining
X=(#Tab1#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterCurrentMonthCritical]
Meter=String
MeasureName=mTerm1CriticalDaysRemaining
X=(#Tab2#+45)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

terms.png
EDIT: JSMorley posted a tip regarding working with time and date calculations using a Lua script. I highly recommend looking at his approach when calculating elapsed time.
You do not have the required permissions to view the files attached to this post.
Craash
Posts: 27
Joined: October 17th, 2017, 4:37 pm

Re: Assistance with Calculating Term End Dates

Craash » May 22nd, 2019, 4:29 pm

This is EXACTLY what I was hoping for. The critical actions days are a few days off, but enough to get me in the ballpark. Thank you so much!

Image
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3537
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Assistance with Calculating Term End Dates

eclectic-tech » May 23rd, 2019, 12:43 am

Happy to help!
Craash
Posts: 27
Joined: October 17th, 2017, 4:37 pm

Re: Assistance with Calculating Term End Dates

Craash » June 2nd, 2019, 4:11 pm

@eclectic-tech,

This is wonderful and I appreciate you help so much.

I have two tweaks I've spent some time on with no luck. Could I ask for help one more time?

First, the dates/wks/Critical action doesn't refresh unless I right click/refresh.

Secondly, I'd like to add one last line that shows the date in m/d/yy format, 10 days prior to today (including today).

So, for 6.2.19, the skin would display 5/24/19.

Again, I think you so much for the assistance you have provided.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3537
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Assistance with Calculating Term End Dates

eclectic-tech » June 2nd, 2019, 7:28 pm

Craash wrote:
June 2nd, 2019, 4:11 pm
@eclectic-tech,

This is wonderful and I appreciate you help so much.

I have two tweaks I've spent some time on with no luck. Could I ask for help one more time?

First, the dates/wks/Critical action doesn't refresh unless I right click/refresh.

Secondly, I'd like to add one last line that shows the date in m/d/yy format, 10 days prior to today (including today).

So, for 6.2.19, the skin would display 5/24/19.

Again, I think you so much for the assistance you have provided.
From your previous posted image, I see you made a few changes to the display.

It may be best if you can post your current code for that skin for me to use as a starting point. Copy all of the skin code in your editor, then paste it in between code tags </> in reply.

I will look into the feasibility of your change requests in the meantime.

Regards... :)

EDIT: Reworked the code to refresh when the day changes, matched titles to your posted image, added a calculation and display for 10 days prior, and modified previous first month critical to display "Past" instead of "0".

You may need to modify positions, but this should help with the changes you requested.
termsnew.png
Updated code for Terms:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=255,0,0,0
;*****************************
SkinWidth=341
SkinHeight=200
ContextTitle=Open @Includes Folder
ContextAction=["#@#"]
ContextTitle2=---
ContextAction2=[]
ContextTitle3=More Actions...
ContextAction3=[!SkinMenu]
RightMouseUpAction=!SkinCustomMenu


[Variables]
; Font Variables
TextFont=Fira Sans
MonoFont=Fira Mono
TextSize=12

; Color Variables
LabelColor=208,224,247
ValueColor=247,252,255,255
BarBackColor=#LabelColor#,75
BackgroundAlpha=200
BackgroundColor=0,0,0,#BackgroundAlpha#
; Positioning
Tab0=10
Tab1=115
Tab2=200
TabOffset=15

Term1Critical=13204938054
Term1End=13216382871
‬
; ============== Measures ==============
; =====================================

[mTime]
Measure=Time

[mYear]
Measure=Time
Format=%#y

[mPreviousYear]
Measure=Calc
Formula=mYear-1

[mMonth]
Measure=Time
Format=%#m

[PreviousMonth1]
Measure=calc
Formula=((mMonth - 1 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth1 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth1 MeasureName2 "mYear"]

[PreviousMonth2]
Measure=calc
Formula=((mMonth - 2 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth2 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth2 MeasureName2 "mYear"]

[PreviousMonth3]
Measure=calc
Formula=((mMonth - 3 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth3 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth3 MeasureName2 "mYear"]

[PreviousMonth4]
Measure=calc
Formula=((mMonth - 4 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth4 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth4 MeasureName2 "mYear"]

[PreviousMonth5]
Measure=calc
Formula=((mMonth - 5 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth5 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth5 MeasureName2 "mYear"]

[mDay]
Measure=Time
Format=%#d
; Actions to create a new term, delete oldest term and set 45 day point
IfCondition=(#CurrentSection#=1)
IfTrueAction=[!EnableMeasureGroup NewTerm][!UpdateMeasureGroup NewTerm][!DisableMeasureGroup NewTerm]
OnChangeAction=[!Refresh]

[mTerm1Plus45Days]
Group=NewTerm
Measure=Calc
Formula=mTime + (45 * 86400)
OnUpdateAction=[!SetVariable Term1Critical [mTerm1Plus45Days]][!WriteKeyValue Variables Term1Critical [mTerm1Plus45Days]]
Disabled=1

[mTerm1CriticalDaysRemaining]
Measure=Calc
Formula=Round((#Term1Critical# - mTime)/86400)

[mPreviousTermCritical]
Measure=Calc
Formula=Clamp(mTerm1CriticalDaysRemaining - 30,0,15)
DynamicVariables=1
IfCondition=#CurrentSection#=0
IfTrueAction=[!SetOption MeterPreviousMonth1Critical Text Past]

[mTerm1End]
Group=NewTerm
Measure=Calc
Formula=mTime + 24 * 604800
OnUpdateAction=[!SetVariable Term1End [mTerm1End]][!WriteKeyValue Variables Term1End [mTerm1End]]
Disabled=1

[mTerm1WeeksRemaining]
Measure=Calc
Formula=Round((#Term1End# - mTime)/604800)

[mTerm2WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 4,0,22)

[mTerm3WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 8,0,22)

[mTerm4WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 12,0,22)

[mTerm5WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 16,0,22)

[mTerm6WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 20,0,22)

[mTimeMinus10Days]
Measure=Calc
Formula=(mTime - (9 * 86400))

[mDateMinus10]
Measure=Time
Timestamp=[mTimeMinus10Days:TimeStamp]
Format=%m/%d/%y
DynamicVariables=1

; Meters
; =====================================

[MeterNetBackground]
Meter=Shape
;Shape=Rectangle 1,1,169,103,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
Shape=Rectangle 1,1,260,170,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
;X=(#NetOffSet#)
UpdateDivider=-1
DynamicVariables=1

;Term Start____ Weeks Left___ Critical Action
[MeterTitle1]
Meter=String
X=#Tab0#
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=TERM

[MeterTitle2]
Meter=String
X=#Tab1#
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=WKS

[MeterTitle3]
Meter=String
X=(#Tab2#+5)
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=CA

[MeterPreviousMonth5]
Meter=String
MeasureName=PreviousMonth5
MeasureName2=mYear
X=#Tab0#
Y=20r
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1/1/%2
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth5WeeksLeft]
Meter=String
MeasureName=mTerm6WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth5Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth4]
Meter=String
MeasureName=PreviousMonth4
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth4WeeksLeft]
Meter=String
MeasureName=mTerm5WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth4Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth3]
Meter=String
MeasureName=PreviousMonth3
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth3WeeksLeft]
Meter=String
MeasureName=mTerm4WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth3Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth2]
Meter=String
MeasureName=PreviousMonth2
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth2WeeksLeft]
Meter=String
MeasureName=mTerm3WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth2Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth1]
Meter=String
MeasureName=PreviousMonth1
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth1WeeksLeft]
Meter=String
MeasureName=mTerm2WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth1Critical]
Meter=String
MeasureName=mPreviousTermCritical
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterCurrentMonth]
Meter=String
MeasureName=mMonth
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterCurrentMonthWeeksRemaining]
Meter=String
MeasureName=mTerm1WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterCurrentMonthCritical]
Meter=String
MeasureName=mTerm1CriticalDaysRemaining
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[Date10]
Meter=String
MeasureName=mDateMinus10
X=125
Y=20r
StringAlign=Center
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
Text=Prior 10 Day Date: %1
You do not have the required permissions to view the files attached to this post.
Craash
Posts: 27
Joined: October 17th, 2017, 4:37 pm

Re: Assistance with Calculating Term End Dates

Craash » June 3rd, 2019, 9:30 am

You truly are amazing!

Something has changed, and I can't find it. I'll include my code below. In this picture, the top image is the skin before modifications. The middle skin is after I applied my formatting to the new code (and is what is included below). Of course I thought I had messed something up because of the calculations, so I added the new code, unchanged, to a new skin (the bottom one). It is doing the same. Ideas? I do notice that they seem to be correct in the image you posted . . . .

Image

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=255,0,0,0
;*****************************
SkinWidth=171
SkinHeight=230
ContextTitle=Open @Includes Folder
ContextAction=["#@#"]
ContextTitle2=---
ContextAction2=[]
ContextTitle3=More Actions...
ContextAction3=[!SkinMenu]
RightMouseUpAction=!SkinCustomMenu


[Variables]
; Font Variables
TextFont=Fira Sans
MonoFont=Fira Mono
TextSize=10

; Color Variables
LabelColor=208,224,247
ValueColor=247,252,255,255
BarBackColor=#LabelColor#,75
BackgroundAlpha=200
BackgroundColor=0,0,0,#BackgroundAlpha#
; Positioning
Tab0=10
Tab1=55
Tab2=110
TabOffset=30

Term1Critical=13204938054
Term1End=13216382871
‬
; ============== Measures ==============
; =====================================

[mTime]
Measure=Time

[mYear]
Measure=Time
Format=%#y

[mPreviousYear]
Measure=Calc
Formula=mYear-1

[mMonth]
Measure=Time
Format=%#m

[PreviousMonth1]
Measure=calc
Formula=((mMonth - 1 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth1 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth1 MeasureName2 "mYear"]

[PreviousMonth2]
Measure=calc
Formula=((mMonth - 2 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth2 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth2 MeasureName2 "mYear"]

[PreviousMonth3]
Measure=calc
Formula=((mMonth - 3 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth3 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth3 MeasureName2 "mYear"]

[PreviousMonth4]
Measure=calc
Formula=((mMonth - 4 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth4 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth4 MeasureName2 "mYear"]

[PreviousMonth5]
Measure=calc
Formula=((mMonth - 5 + 11) % 12) + 1
IfCondition=(#CurrentSection#>mMonth)
IfTrueAction=[!SetOption MeterPreviousMonth5 MeasureName2 "mPreviousYear"]
IfFalseAction=[!SetOption MeterPreviousMonth5 MeasureName2 "mYear"]

[mDay]
Measure=Time
Format=%#d
; Actions to create a new term, delete oldest term and set 45 day point
IfCondition=(#CurrentSection#=1)
IfTrueAction=[!EnableMeasureGroup NewTerm][!UpdateMeasureGroup NewTerm][!DisableMeasureGroup NewTerm]
OnChangeAction=[!Refresh]

[mTerm1Plus45Days]
Group=NewTerm
Measure=Calc
Formula=mTime + (45 * 86400)
OnUpdateAction=[!SetVariable Term1Critical [mTerm1Plus45Days]][!WriteKeyValue Variables Term1Critical [mTerm1Plus45Days]]
Disabled=1

[mTerm1CriticalDaysRemaining]
Measure=Calc
Formula=Round((#Term1Critical# - mTime)/86400)

[mPreviousTermCritical]
Measure=Calc
Formula=Clamp(mTerm1CriticalDaysRemaining - 30,0,15)
DynamicVariables=1
IfCondition=#CurrentSection#=0
IfTrueAction=[!SetOption MeterPreviousMonth1Critical Text Past]

[mTerm1End]
Group=NewTerm
Measure=Calc
Formula=mTime + 24 * 604800
OnUpdateAction=[!SetVariable Term1End [mTerm1End]][!WriteKeyValue Variables Term1End [mTerm1End]]
Disabled=1

[mTerm1WeeksRemaining]
Measure=Calc
Formula=Round((#Term1End# - mTime)/604800)

[mTerm2WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 4,0,22)

[mTerm3WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 8,0,22)

[mTerm4WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 12,0,22)

[mTerm5WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 16,0,22)

[mTerm6WeeksRemaining]
Measure=Calc
Formula=Clamp(mTerm1WeeksRemaining - 20,0,22)

[mTimeMinus10Days]
Measure=Calc
Formula=(mTime - (9 * 86400))

[mDateMinus10]
Measure=Time
Timestamp=[mTimeMinus10Days:TimeStamp]
Format=%m/%d/%y
DynamicVariables=1

; Meters
; =====================================

[MeterNetBackground]
Meter=Shape
;Shape=Rectangle 1,1,169,103,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
Shape=Rectangle 1,1,169,170,12 | Fill Color #BackgroundColor# | StrokeWidth 1 | Stroke Color #LabelColor#
;X=(#NetOffSet#)
UpdateDivider=-1
DynamicVariables=1

;Term Start____ Weeks Left___ Critical Action
[MeterTitle1]
Meter=String
X=#Tab0#
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=Term

[MeterTitle2]
Meter=String
X=(#Tab1#+14)
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=WKS

[MeterTitle3]
Meter=String
X=(#Tab2#+20)
Y=5
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=CA

[MeterPreviousMonth5]
Meter=String
MeasureName=PreviousMonth5
MeasureName2=mYear
X=#Tab0#
Y=20r
W=100
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1/1/%2
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth5WeeksLeft]
Meter=String
MeasureName=mTerm6WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth5Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth4]
Meter=String
MeasureName=PreviousMonth4
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth4WeeksLeft]
Meter=String
MeasureName=mTerm5WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth4Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth3]
Meter=String
MeasureName=PreviousMonth3
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth3WeeksLeft]
Meter=String
MeasureName=mTerm4WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth3Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth2]
Meter=String
MeasureName=PreviousMonth2
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth2WeeksLeft]
Meter=String
MeasureName=mTerm3WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth2Critical]
Meter=String
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=Past
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth1]
Meter=String
MeasureName=PreviousMonth1
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterPreviousMonth1WeeksLeft]
Meter=String
MeasureName=mTerm2WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterPreviousMonth1Critical]
Meter=String
MeasureName=mPreviousTermCritical
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterCurrentMonth]
Meter=String
MeasureName=mMonth
MeasureName2=mYear
X=#Tab0#
Y=20r
W=105
H=17
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
DynamicVariables=1
Text=%1/1/%2

[MeterCurrentMonthWeeksRemaining]
Meter=String
MeasureName=mTerm1WeeksRemaining
X=(#Tab1#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[MeterCurrentMonthCritical]
Meter=String
MeasureName=mTerm1CriticalDaysRemaining
X=(#Tab2#+#TabOffset#)
Y=r
W=100
H=17
StringAlign=Center
ClipString=1
SolidColor=0,0,0,1
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
Text=%1
AntiAlias=1
DynamicVariables=1

[Date10]
Meter=String
MeasureName=mDateMinus10
X=70
Y=20r
StringAlign=Center
InlineSetting=Face | #TextFont#
InlineSetting2=Size | #TextSize#
InlineSetting3=Color | #ValueColor#,255
AntiAlias=1
Text=INA (10): %1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3537
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Assistance with Calculating Term End Dates

eclectic-tech » June 3rd, 2019, 11:29 am

The code is designed to create the term and critical days at precisely 12:00 am on the first day of the month (the "stick in the sand"). The rest of the time it is comparing the current time to that marker.

I had not used the code so the term variables were not set correctly in the code I pasted (sorry)! :oops:

The 2 term timestamp variables need to be either entered manually as:

Code: Select all

Term1Critical=13207708800
Term1End=13218336000
Note: I could not get the skin to work when I pasted those values; got a syntax error...
I reset the skin by loading the skin. Then I went into my Win10 Settings, and set the time and date manually to May 31, 2019 11:59 pm, and let the skin automatically set those variables when it reached midnight. Then changed the time back to automatic.

It's too early here for me to suggest any other solution, but after a few cups of java, I will look at creating a way for you to reset the terms in the skin if it loses it's "stick in the sand".