Comments (5)
c.LunarToGregorian(2020,4,14,true)
对于农转公,能否去掉这个true,自动实现?
from gocalendar.
想错了,通过新历转农历反推就行了。
from gocalendar.
如果只是给农历的年月日,而不给出是否是闰月的话,如:农历2020年四月十四,这样的话就对应了两个公历日期,分别是2020-05-06和2020-06-05。
在一些普通的应用中,存储用户的农历数据(主要是生日),一般是加一个是否是农历的类别判断,一些社交应用都是这样做的,这其实是不完整或者说是有局限的。准确的做法是,选择生日是农历之后,还应该显示一个选项是否是闰月。
(如果应用只是记录生日,其实可以忽略闰月,因为农历闰月生日如果在闰月的话,一般会改成非闰月,否则一辈子也过不了几个生日。)
from gocalendar.
如果只是给农历的年月日,而不给出是否是闰月的话,如:农历2020年四月十四,这样的话就对应了两个公历日期,分别是2020-05-06和2020-06-05。 在一些普通的应用中,存储用户的农历数据(主要是生日),一般是加一个是否是农历的类别判断,一些社交应用都是这样做的,这其实是不完整或者说是有局限的。准确的做法是,选择生日是农历之后,还应该显示一个选项是否是闰月。
(如果应用只是记录生日,其实可以忽略闰月,因为农历闰月生日如果在闰月的话,一般会改成非闰月,否则一辈子也过不了几个生日。)
我非常认同您的说法,但是这个太严谨了,不太适合人们现在的情况。更多的人可能就不会/不知道自己是否闰月,所以能否开个口子,做个松散模式呢?
from gocalendar.
你在使用农历转公历时,默认用非闰月(false)就行了,如果有特另需求,我在下一个版本中会为此特别写一个方法
from gocalendar.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocalendar.