Please enable JavaScript to view this site.

 

bool = chIsLeapMonth(nWesternDate)

 

This macro function returns true if the date nWesternDate corresponds to a leap month of the Chinese calendar (闰月).

 

This function can be used to mimic the [chMM] token, which displays the Chinese lunar month number with the symbol for the month (月) and the symbol denoting a short (小) or long month (大), as in the macro below.

// manually calculate the tokens [chMM]
nLunarMonth = chMonthOf(n_TokenDate)
// convert lunar month number to Chinese characters
if chIsLeapMonth(n_TokenDate)
   sChLunarMonth = '闰' + sChLunarMonth
endif
// display the result depending on the month
sResult = '[chMM] is ' + sChLunarMonth + '月'
if bMonthIsLong
   sResult = sResult + '大'
else
   sResult = sResult + '小'
endif

See also: chinese dates functions.

 


Topic 160500, last updated on 18-Apr-2020