Code Monkey home page Code Monkey logo

tyme4j's Introduction

Tyme License

Tyme是一个非常强大的日历工具库,可以看作 Lunar 的升级版,拥有更优的设计和扩展性,支持公历和农历、星座、干支、生肖、节气、法定假日等。

Maven

<dependency>
  <groupId>cn.6tail</groupId>
  <artifactId>tyme4j</artifactId>
  <version>1.1.1</version>
</dependency>

示例

import com.tyme.solar.SolarDay;
 
public class Sample {
  public static void main(String[] args) {
    SolarDay solarDay = SolarDay.fromYmd(1986, 5, 29);
     
    // 1986年5月29日
    System.out.println(solarDay);
     
    // 农历丙寅年四月廿一
    System.out.println(solarDay.getLunarDay());
  }
}

文档

请移步至 https://6tail.cn/tyme.html

Star History

Star History Chart

tyme4j's People

Contributors

6tail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tyme4j's Issues

localdate 互转

提个建议,可以加上 jdk 8 的 localdate 类型互转的方法

童限信息在 2 月时未考虑实际年月情况

Tyme 版本:cn.6tail:tyme4j:1.1.1,截止到目前,都会存在如下问题:

public class TymeTest {
    public static void main(String[] args) {
        ChildLimit childLimit = ChildLimit.fromSolarTime(SolarTime.fromYmdHms(1989, 12, 31, 23, 07, 17), Gender.MAN);
        System.out.println(childLimit);
    }
}

当以上述 Case 跑的时候,童限信息计算出来是 1998-02-29,但是 1998 的 2 月没有 28 日。

image

会报以下异常:

Exception in thread "main" java.lang.IllegalArgumentException: illegal solar day: 1998-2-29
	at com.tyme.solar.SolarDay.<init>(SolarDay.java:56)
	at com.tyme.solar.SolarDay.fromYmd(SolarDay.java:63)
	at com.tyme.solar.SolarTime.<init>(SolarTime.java:55)
	at com.tyme.solar.SolarTime.fromYmdHms(SolarTime.java:62)
	at com.tyme.eightchar.provider.impl.DefaultChildLimitProvider.getInfo(DefaultChildLimitProvider.java:53)
	at com.tyme.eightchar.ChildLimit.<init>(ChildLimit.java:56)
	at com.tyme.eightchar.ChildLimit.fromSolarTime(ChildLimit.java:67)

命宫计算问题

命宫计算中,没有考虑到过了月中气需要+1的情况。
不过要实现这种情况,需要有每月月中气时间对照表,有点麻烦。

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.