It is currently April 12th, 2021, 4:17 am

GlobalCalendarRM [v0.1.0.0]

Share and get help with Plugins and Addons
oZone
Posts: 140
Joined: May 14th, 2018, 4:46 pm

GlobalCalendarRM [v0.1.0.0]

Post by oZone »

I am working on plugin which allows converting Gregorian calendar to other calendars.
GlobalCalendarRM.png
This is my first time coding in C# :D .

Code: Select all

;example, return current year in Julian calendar
[mYear]
Measure=Plugin
Plugin=GlobalCalendarRM
Calendar=Julian
Lunar=0
DateTime=
DataType=year
Valid values for Calendar option with Lunar=0 are: hebrew, hijiri, julian, persian, thaibuddhist, umalqura, japanese, korean and taiwan
default value is "empty" string and plugin will use Gregorian calendar

Valid values for Calendar option with Lunar=1 are: japanese, korean and taiwan
default value is "empty" string and plugin will use chinese lunar calendar

Valid values for DataType option are:
  • day – will return day of month
  • month – will return month
  • year – will return year
  • era – will return era
  • dayofweek – will return day of week, Sunday is 0, Monday is 1, ...
  • dayofyear – will return day of year
  • weekofyear – will return week of year
  • daysinmonth – will return number of days in month
  • daysinyear – will return number of days in year
  • monthsinyear – will return number of months in year
  • leapmonth – will return if leap month, if calendar support it, if not then 0
  • isleapday – will return 1 day is leap day, if not then 0
  • isleapmonth – will return 1 month is leap month, if not then 0
  • isleapyear – will return 1 year is leap year, if not then 0
with Lunar=1
  • sexagenaryyear – will return year in the sexagenary cycle
  • celestialstem – will return celestial stem
  • terrestrialbranch – will return terrestrial branch
for wrong values will return -1

DateTime option allows to use custom date. To determine best format to parse use

Code: Select all

[mTime]
Measure=Time
Format=locale-date
for example DateTime=5 Feb 2021

Source Code and latest releases:
https://github.com/ozone10/Rainmeter-GlobalCalendarRM
You do not have the required permissions to view the files attached to this post.
Last edited by oZone on February 28th, 2021, 3:08 pm, edited 1 time in total.
User avatar
SilverAzide
Rainmeter Sage
Posts: 1203
Joined: March 23rd, 2015, 5:26 pm

Re: GlobalCalendarRM [v0.1.0.0]

Post by SilverAzide »

ISO weekofyear and ISO year might be handy too. ;-)
(System.Globalization.ISOWeek)
Gadgets Wiki GitHub More Gadgets...
oZone
Posts: 140
Joined: May 14th, 2018, 4:46 pm

Re: GlobalCalendarRM [v0.1.0.0]

Post by oZone »

SilverAzide wrote: February 5th, 2021, 9:23 pm ISO weekofyear and ISO year might be handy too. ;-)
(System.Globalization.ISOWeek)
Sorry for late reply.
Unfortunately .NET framework 4.8 does not support it, and not everyone has .NET 5.0 or .NET Core 3.0.