Conversation
TODO it must be convert korean lunar calendar
- kr.BeforeLunarNewYear - kr.AfterLunarNewYear - kr.BeforeChuseok - kr.AfterChuseok
rickar
left a comment
There was a problem hiding this comment.
Thanks, this is cool. I've never looked at lunar calendar stuff before.
| Julian bool // the holiday is based on a Julian calendar | ||
| Observed []AltDay // the substitution days for the holiday | ||
| Func HolidayFn // logic used to determine occurrences | ||
| Lunar bool // the holiday is based on a Lunar calendar |
There was a problem hiding this comment.
I don't see this used anywhere. Is it needed?
There was a problem hiding this comment.
some kr holidays uses Lunar flag. such as https://github.com/aanoaa/cal/blob/kr-holidays/v2/kr/kr_holidays.go#L45
| @@ -0,0 +1,9 @@ | |||
| root = true | |||
There was a problem hiding this comment.
Please delete this file. We use whatever "go fmt" dictates.
| @@ -0,0 +1,1232 @@ | |||
| package kr | |||
There was a problem hiding this comment.
Was this generated somehow? What was the source? Is there some way to calculate this at runtime rather than have this huge file?
There was a problem hiding this comment.
I'll find a way.
some of data from..
https://www.kasi.re.kr/kor/index
(Korea Astronomical Research Institute)
but i can't found this meta data today.
and chinese lunar calendar data depends on https://github.com/godcong/chronos/blob/master/data.go
I haven't verified it.
| } | ||
| ) | ||
|
|
||
| // CalcDayOfLunarMonth calculates the occurrence of a holiday that is always a |
There was a problem hiding this comment.
Do you think these would be used by other lunar calendars? Maybe these functions along with data.go and lunar.go should be moved to something like 'aa/lunar' where it can be shared?
There was a problem hiding this comment.
korean, chinese and japanese lunar calendars are different.
each lunar calendar should implements on they requirements.
I don't think it needs to be shared.
| return time.Date(y, time.Month(m), d, 0, 0, 0, 0, cal.DefaultLoc) | ||
| } | ||
|
|
||
| func julianDayToDate(jd int) (year, month, day int) { |
There was a problem hiding this comment.
There are already Julian functions in cal_funcs.go. Do those not work?
Repulic of Korea holidays contains lunar calendar.
and the Korean lunar calendar is different from that of China.