Skip to content

Add methods that are related with substitute holiday

Latest
Compare
Choose a tag to compare
@pinzolo pinzolo released this 29 Jun 11:46
· 12 commits to master since this release
c9f0071

Add methods to Holiday interface that is related with substitute holiday.

Original

If holiday is substitute holiday, Original method returns original holiday.

ex:

d, _ := flagday.PublicHolidayOf(2009, 5, 6)
fmt.Println(d.Kind() == flagday.SubstituteHoliday) // true
fmt.Println(d.Original().Time().Format("2006/1/2") // 2009/5/3

IsSubstituted

If holiday is original holiday, IsSubstituted method returns true.

ex:

d, _ := flagday.PublicHolidayOf(2009, 5, 3)
fmt.Println(d.IsSubstituted()) // true