It is currently April 25th, 2024, 5:37 am

How to make time skin with "pasaran"

Get help with creating, editing & fixing problems with skins
febrimuhnas
Posts: 2
Joined: April 10th, 2020, 6:08 am

How to make time skin with "pasaran"

Post by febrimuhnas »

Hello everyone. Sorry but I need your help because i'm new member. I want to make the time skin it contains: time, date, weekday, pasaran, month and year.
I know how to make time, date, weekday, month and year in time skin but i dont know how to make "pasaran".
FYI, pasaran is Javanese 5-day week (for futher information: https://en.wikipedia.org/wiki/Javanese_calendar#Five-day_week_(Pasaran)). as I recall, the way to find "pasaran" is to use JDN (Julian day number) like in https://id.wikipedia.org/wiki/Templat:CURRENTPASARAN, but I don't know how to make it on rainmeter.

So, I need your help to make code, lua or something to display pasaran.
Thank you for your help :bow:

P.S. sorry for my bad English. the example output I expect is: Monday Legi, November 21, 2090 (Day Pasaran, Month Date, Year)
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make time skin with "pasaran"

Post by Yincognito »

febrimuhnas wrote: April 10th, 2020, 7:19 am Hello everyone. Sorry but I need your help because i'm new member. I want to make the time skin it contains: time, date, weekday, pasaran, month and year.
I know how to make time, date, weekday, month and year in time skin but i dont know how to make "pasaran".
FYI, pasaran is Javanese 5-day week (for futher information: https://en.wikipedia.org/wiki/Javanese_calendar#Five-day_week_(Pasaran)). as I recall, the way to find "pasaran" is to use JDN (Julian day number) like in https://id.wikipedia.org/wiki/Templat:CURRENTPASARAN, but I don't know how to make it on rainmeter.

So, I need your help to make code, lua or something to display pasaran.
Thank you for your help :bow:

P.S. sorry for my bad English. the example output I expect is: Monday Legi, November 21, 2090 (Day Pasaran, Month Date, Year)
First of all, what you linked at https://id.wikipedia.org/wiki/Templat:CURRENTPASARAN doesn't exist, or doesn't have any content that one can see, so it's not helpful (edit: after further trying all avenues to see what's there, I managed to get this:

Code: Select all

{{mod|{{#expr: floor({{CURRENTJULIANDAY}}*1440)/1440 round 0 }}+1|5}}{{#switch: {{mod|{{#expr: floor({{CURRENTJULIANDAY}}*1440)/1440 round 0 }}+1|5}}
 | 0 = Kliwón
 | 1 = Lěgi
 | 2 = Pahing
 | 3 = Pón
 | 4 = Wagé
 | ''Error''
}}
but I seriously doubt it's that simple). For example, after reading a bit on Wiki about it, I found this code on GitHub by François Beauducel (also available here, by clicking on the Functions tab) regarding the conversion between Gregorian calendar dates and pasaran, and it looks pretty complex to me. That in itself wouldn't be a huge problem, but there are lots and lots of things I don't understand there, like the relation between the pasaran and the Islamic calendar, the moon phases or cycles, the other custom cycles of the Javanese people and the overall jargon that is probably only familiar to someone from Java / Indonesia.

In other words, I don't know if anyone here would be able to understand those concepts, the associated math and cosmology and help you write a skin to display that. What can be done though, is for you to try to understand (all or some bits of) the conversion process in that code (since you're most likely familiar with it, being a wiki contributor), and only then ask us here to help you "translate" what you want to happen in terms of the process into Rainmeter code. The latter part, if you already know what needs to be done, shouldn't be a problem on this forum - we gladly help everyone, but obviously we must first understand the idea / the "methodology" of the process ourselves... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to make time skin with "pasaran"

Post by eclectic-tech »

Just like Yincognito, I search for a better understanding and found a few sites with conversions.
Looking at the javascripts in those pages I did find this conversion for "pasaran"... I do not know if this will help, but it should return the pasar for the current Gregorian date.

Code: Select all

	function pasaran(y, m, d) {
	 var pasaran = new Array('Legi','Pahing','Pon','Wage','Kliwon',);
	 var d2 = new Date("1938/1/1");
	 var d1 = new Date(y +'/'+ m +'/'+ d);
	 var selisih = Math.floor(Math.abs(d1-d2)/86400000);
	 var pasar = pasaran[selisih%5];
	 return pasar;

There are also scripts on those pages to convert Gregorian to Julian and covert Julian to Islamic.
I can post more details if you need, but my unfamiliarity with your calendar(s) makes it difficult to suggest a definitive answer.
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make time skin with "pasaran"

Post by Yincognito »

I would be surprised if it would be that simple as choosing a "known" pasaran in the past and then getting the modulo / remainder of the difference in days between the current day and the known pasaran, divided by 5... Or if it were just a matter of 35 (i.e. 7 days x 5 days) days cycle... :confused:

But then, who am I to stand in front of simplicity? If only it was like that, than that would be great. If I had been 100% that it was that easy, I would have advanced a solution already - hopefully, I was wrong when not proceeding with it. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make time skin with "pasaran"

Post by Yincognito »

Well, since it apparently it's that simple as using the already mentioned modulo formulas, here is a "pure" Rainmeter solution.

Code:

Code: Select all

[Variables]

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[MeasureKnownPasaran]
Measure=Time
TimeStamp=2008-05-05
TimeStampFormat=%Y-%m-%d
Format=%A Pon, %B %#d, %Y

[MeasureCurrentPasaran]
Measure=Calc
Formula=((5+(Floor(([MeasureCurrentDatePasaran:TimeStamp]-[MeasureKnownPasaran:TimeStamp])/(24*60*60))%5))%5)
RegExpSubstitute=1
Substitute="^0$":"Pon","^1$":"Wage","^2$":"Kliwon","^3$":"Legi","^4$":"Pahing"
DynamicVariables=1

[MeasureCurrentDatePasaran]
Measure=Time
Format=%A [MeasureCurrentPasaran], %B %#d, %Y
DynamicVariables=1

[MeasureAnotherPasaran]
Measure=Calc
Formula=((5+(Floor(([MeasureAnotherDatePasaran:TimeStamp]-[MeasureKnownPasaran:TimeStamp])/(24*60*60))%5))%5)
RegExpSubstitute=1
Substitute="^0$":"Pon","^1$":"Wage","^2$":"Kliwon","^3$":"Legi","^4$":"Pahing"
DynamicVariables=1

[MeasureAnotherDatePasaran]
Measure=Time
TimeStamp=2090-11-21
TimeStampFormat=%Y-%m-%d
Format=%A [MeasureAnotherPasaran], %B %#d, %Y
DynamicVariables=1

---Meters---

[MeterPasaran]
Meter=STRING
X=0
Y=0
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
InlineSetting=Color | 255,128,64,255
InlinePattern="(?siU)= [^, ]* ([^, ]*),"
MeasureName=MeasureKnownPasaran
MeasureName2=MeasureCurrentDatePasaran
MeasureName3=MeasureAnotherDatePasaran
Text="Known Pasaran = %1#CRLF#Current Date = %2#CRLF#Another Date = %3"
DynamicVariables=1
Preview:
Pasaran.jpg
It uses the fact that according to this, 5 May 2008 was a Pon (in Pasaran terms), and calculates the current and another pasaran based on that. Verified the results using the pasaran calculator here (thank you, Chrome, for translating the page to English), and they appear to be correct. In the end, it was that easy - I guess that French guy I mentioned in my first post on this topic was just too meticulous in providing all kinds of Javanese calendar features that scared the hell out of me instead of keeping it pasaran-ly simple... :D

Additional sources (also translated to English): How To Know Weton Based On Date Of Birth (didn't get much from there, but had nicely colored tables :p )

That being said, why the heck every date I can think of is a ... Legi? Any cosmological significance to this? Hm... must have been a powerful Javanese monarch in another life, apparently. Just joking, of course - me and pasaran are buddies now. ;-)

P.S. Ha! Just discovered that my day of birth tells me I'm a ... Kliwon. I knew me and Star Trek's Worf had something in common - damn, this is super fun...
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
febrimuhnas
Posts: 2
Joined: April 10th, 2020, 6:08 am

Re: How to make time skin with "pasaran"

Post by febrimuhnas »

Yincognito wrote: April 10th, 2020, 2:39 pm First of all, what you linked at https://id.wikipedia.org/wiki/Templat:CURRENTPASARAN doesn't exist, or doesn't have any content that one can see, so it's not helpful (edit: after further trying all avenues to see what's there, I managed to get this:

Code: Select all

{{mod|{{#expr: floor({{CURRENTJULIANDAY}}*1440)/1440 round 0 }}+1|5}}{{#switch: {{mod|{{#expr: floor({{CURRENTJULIANDAY}}*1440)/1440 round 0 }}+1|5}}
 | 0 = Kliwón
 | 1 = Lěgi
 | 2 = Pahing
 | 3 = Pón
 | 4 = Wagé
 | ''Error''
}}
but I seriously doubt it's that simple). For example, after reading a bit on Wiki about it, I found this code on GitHub by François Beauducel (also available here, by clicking on the Functions tab) regarding the conversion between Gregorian calendar dates and pasaran, and it looks pretty complex to me. That in itself wouldn't be a huge problem, but there are lots and lots of things I don't understand there, like the relation between the pasaran and the Islamic calendar, the moon phases or cycles, the other custom cycles of the Javanese people and the overall jargon that is probably only familiar to someone from Java / Indonesia.

In other words, I don't know if anyone here would be able to understand those concepts, the associated math and cosmology and help you write a skin to display that. What can be done though, is for you to try to understand (all or some bits of) the conversion process in that code (since you're most likely familiar with it, being a wiki contributor), and only then ask us here to help you "translate" what you want to happen in terms of the process into Rainmeter code. The latter part, if you already know what needs to be done, shouldn't be a problem on this forum - we gladly help everyone, but obviously we must first understand the idea / the "methodology" of the process ourselves... :???:
sorry because from the beginning I did not explain in more detail. :rofl:
The term pasaran comes from the Javanese language "pasar" which means market. as the name suggests, in the past the pasaran was used to mark the day when a traditional market was open. for example: pasar kliwon (kliwon market), means that the market will only open on "kliwon" pasaran day. So, the pasaran has nothing to do with the Islamic / Gregorian calendar. it's just five-day week (just like, you know, Sunday school is only held on Sundays).
the pasaran is precisely related to weekdays. the combination of the two produces Weton. of course I will not explain what is Weton but in short, with the guidance of Weton, Javanese people can determine a person's good or bad karma, when someone's good day to get married, etc. (same as the zodiac, but the pasaran is the daily version). Yup, this all has to do with Javanese astrology and mythology hahaha :rofl:
because 40% of Indonesia's population is Javanese, and the central government is in Java, the pasaran still plays an important role in Javanese and Indonesian culture. In fact, Muslims in Indonesia still use it. so, it is very useful and worth it if it is made in a skin rainmeter.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make time skin with "pasaran"

Post by Yincognito »

febrimuhnas wrote: April 11th, 2020, 3:56 am sorry because from the beginning I did not explain in more detail. :rofl:
The term pasaran comes from the Javanese language "pasar" which means market. as the name suggests, in the past the pasaran was used to mark the day when a traditional market was open. for example: pasar kliwon (kliwon market), means that the market will only open on "kliwon" pasaran day. So, the pasaran has nothing to do with the Islamic / Gregorian calendar. it's just five-day week (just like, you know, Sunday school is only held on Sundays).
the pasaran is precisely related to weekdays. the combination of the two produces Weton. of course I will not explain what is Weton but in short, with the guidance of Weton, Javanese people can determine a person's good or bad karma, when someone's good day to get married, etc. (same as the zodiac, but the pasaran is the daily version). Yup, this all has to do with Javanese astrology and mythology hahaha :rofl:
because 40% of Indonesia's population is Javanese, and the central government is in Java, the pasaran still plays an important role in Javanese and Indonesian culture. In fact, Muslims in Indonesia still use it. so, it is very useful and worth it if it is made in a skin rainmeter.
Yeah, I looked over the Excel (and also figured out in the meantime that this is the way it should be done), and that's pretty much the same process that every reply here is approaching. In other words, whether you choose eclectic-tech's (needs to be converted to Lua or Rainmeter code, of course), element's (needs for the offset variable to be adjusted accordingly for "today") or my code, you should get what you want. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to make time skin with "pasaran"

Post by eclectic-tech »

Yincognito wrote: April 11th, 2020, 9:56 am Yeah, I looked over the Excel (and also figured out in the meantime that this is the way it should be done), and that's pretty much the same process that every reply here is approaching. In other words, whether you choose eclectic-tech's (needs to be converted to Lua or Rainmeter code, of course), element's (needs for the offset variable to be adjusted accordingly for "today") or my code, you should get what you want. ;-)
Using Yincognito's modified code, here is my version that returns the pasar for any date after Jan2, 1602.
Prior dates would require further calculations that I'm too busy(lazy) to pursue... :uhuh:

Hover the skin to show input text, click the input text and enter any YYYY/M/D after 1602/1/2, press 'Enter' to see the result.

Code: Select all

; Hover skin to show input text. 
; Click input text, and type in a date after Jan 2, 1602, format: YYYY/M/D
; Uses Jan 2, 1602 as the starting reference for Pasaran day calculation
; Dates before that will NOT show Pasar

; ========= Variables ==========
[Variables]
MyDate=2020/11/4

; ========= Skin Settings ==========
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#
MouseOverAction=[!ShowMeterGroup Input]
MouseLeaveAction=[!HideMeterGroup Input]

; ========= Measures ==========
[MeasureKnownPasaran]
Measure=Time
TimeStamp=1602/1/2
TimeStampFormat=%Y/%m/%d
Format=%A Legi, %B %#d, %Y

[MeasureUserDatePasaran]
Measure=Time
TimeStamp=#MyDate#
TimeStampFormat=%Y/%m/%d
Format=%A [MeasureCurrentPasaran], %B %#d, %Y
DynamicVariables=1

[MeasureCurrentPasaran]
Measure=Calc
Formula=(Floor(([MeasureUserDatePasaran:TimeStamp]-[MeasureKnownPasaran:TimeStamp])/86400)%5)
RegExpSubstitute=1
Substitute="^0$":"Legi","^1$":"Pahing","^2$":"Pon","^3$":"Wage","^4$":"Kliwon"
DynamicVariables=1

; ========= Meters ==========
[MeterString]
Meter=String
MeasureName=MeasureUserDatePasaran
FontColor=255,255,255
SolidColor=0,0,0,100
Padding=4,4,4,4
DynamicVariables=1

[MeterInputTextWrite]
Group=Input
Hidden=1
Meter=String
Y=R
FontSize=
FontColor=
SolidColor=0,0,0,100
Padding=4,4,4,4
Text=Enter Date: YYYY/M/D
LeftMouseUpAction=!CommandMeasure "MeasureInputText" "ExecuteBatch 1-2"

[MeasureInputText]
Group=Input
DynamicVariables=1
Hidden=1
Measure=Plugin
Plugin=InputText
InputLimit=0
InputNumber=0
X=0
Y=[MeterString:YH]
W=[MeterString:W]
H=[MeterString:H]
Command1=[!WriteKeyValue Variables MyDate "$UserInput$"]
Command2=[!Refresh #CURRENTCONFIG#]
DefaultValue=#MyDate#
FontSize=11
FocusDismiss=1

pasaran.gif
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make time skin with "pasaran"

Post by Yincognito »

eclectic-tech wrote: April 11th, 2020, 2:47 pm Using Yincognito's modified code, here is my version that returns the pasar for any date after Jan2, 1602.
Prior dates would require further calculations that I'm too busy(lazy) to pursue... :uhuh:
Nice job - obviously it looks much better than mine. :thumbup: But ... you didn't necessarily have to use the Jan 2 1602 date, since my version could calculate pasaran from the past (naturally, not before 1601, due to the Windows timestamp properties). Just saying, in case you didn't notice... ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to make time skin with "pasaran"

Post by eclectic-tech »

Yincognito wrote: April 11th, 2020, 3:22 pm Nice job - obviously it looks much better than mine. :thumbup: But ... you didn't necessarily have to use the Jan 2 1602 date, since my version could calculate pasaran from the past (naturally, not before 1601, due to the Windows timestamp properties). Just saying, in case you didn't notice... ;-)
Of course... you wouldn't post anything that wasn't versatile! ;-)

I just couldn't resist adding an option to input a date right in the skin, rather than in the code.
Yours is a perfectly good solution, which I simply embellish for my own personal preference... :Whistle

Now I need to figure out what it means when my birthday was on "Pon" day!?
I wish I was rich... so much for astrology (in any language) :x

"Props" for your solution! :thumbup: