Git Product home page Git Product logo

chinese-lunar's Issues

提个 bug

月份不是自定义时,日没加 0, 导致 chineseMonth 和 chineseDay 出错;

重现

就今天,,7 月 9 日;

const lunar = Lunar();
console.log(`${lunar.chineseYear}年【${lunar.animal}年】${lunar.chineseMonth}月 ${lunar.chineseDay}日`) 
//  => 庚子年【鼠年】己卯月 辛酉日

截图

const lunar = Lunar(); // '2020', '07', '9'

image

const lunar = Lunar('2020', '07', '09');

image

表示方式

你好
image
请问,第二个年份是出生年份的第二种表示方式吗?为什么我将2021年转化为第二种表示方式是【辛丑】而不是【壬子】呢。如果不是,那么第二个年份的含义是什么呢?

leading zero on both months and days are implicitly assumed, or different results will be given and no error thrown

tried these 4 test cases, and 3 different dates were given :

tests

  r = lunar("1999","2","2"); check_date( r );
  r = lunar("1999","02","2"); check_date( r );
  r = lunar("1999","2","02"); check_date( r );
  r = lunar("1999","02","02"); check_date( r );

results ( 3 different dates, depends on the presence of leading zero )

######################################################
checking on the day :  1999-2-2
chineseYear  :  己卯
chineseMonth :  丙子
chineseDay   :  壬辰
........................
lunarMonth   :  九月
lunarDay     :  初四
........................
solarTerms   :  冬至
animal       :  兔
######################################################
checking on the day :  1999-02-2
chineseYear  :  己卯
chineseMonth :  丁丑
chineseDay   :  乙酉
........................
lunarMonth   :  腊月
lunarDay     :  十七
........................
solarTerms   :  大寒
animal       :  兔
######################################################
checking on the day :  1999-2-02
chineseYear  :  己卯
chineseMonth :  丙子
chineseDay   :  壬辰
........................
lunarMonth   :  七月
lunarDay     :  初三
........................
solarTerms   :  冬至
animal       :  兔
######################################################
checking on the day :  1999-02-02
chineseYear  :  己卯
chineseMonth :  丁丑
chineseDay   :  乙酉
........................
lunarMonth   :  腊月
lunarDay     :  十七
........................
solarTerms   :  大寒
animal       :  兔

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.