How to use date-chinese - 4 common examples

To help you get started, we’ve selected a few date-chinese examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zhanghai / DoubanYearProgress / index.js View on Github external
function getSolarTermForTime(time) {
    const calendarChinese = new CalendarChinese();
    for (let i = 0; i < 24; ++i) {
        const dateObject = calendarChinese.fromJDE(calendarChinese.solarTerm(i + 1, time.year())).toGregorian();
        const date = moment({
            year: dateObject.year,
            month: dateObject.month - 1,
            day : dateObject.day
        }).tz(timezone);
        if (date.isSame(time, 'day')) {
            return SOLAR_TERM_NAMES[i];
        }
    }
    return null;
}
github commenthol / date-holidays-parser / src / Chinese.js View on Github external
constructor (opts) {
    opts = opts || {}
    super(opts)
    switch (opts.fn) {
      case 'chinese':
        this.cal = new CalChinese.CalendarChinese()
        break
      case 'korean':
        this.cal = new CalChinese.CalendarKorean()
        break
      case 'vietnamese':
        this.cal = new CalChinese.CalendarVietnamese()
        break
    }
  }
github commenthol / date-holidays-parser / src / Chinese.js View on Github external
constructor (opts) {
    opts = opts || {}
    super(opts)
    switch (opts.fn) {
      case 'chinese':
        this.cal = new CalChinese.CalendarChinese()
        break
      case 'korean':
        this.cal = new CalChinese.CalendarKorean()
        break
      case 'vietnamese':
        this.cal = new CalChinese.CalendarVietnamese()
        break
    }
  }
github commenthol / date-holidays-parser / src / Chinese.js View on Github external
constructor (opts) {
    opts = opts || {}
    super(opts)
    switch (opts.fn) {
      case 'chinese':
        this.cal = new CalChinese.CalendarChinese()
        break
      case 'korean':
        this.cal = new CalChinese.CalendarKorean()
        break
      case 'vietnamese':
        this.cal = new CalChinese.CalendarVietnamese()
        break
    }
  }

date-chinese

Chinese Calendar

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis