GithubHelp home page GithubHelp logo

rpplusplus / lunarcalendar Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 9.0 160 KB

一个由 JS 万年历移植而来的,兼容 iOS / Android 的 cpp 日历模块

Objective-C 20.88% Objective-C++ 20.12% JavaScript 28.32% C++ 30.68%

lunarcalendar's Introduction

LunarCalendar

一个由 JS 万年历移植而来的,兼容 iOS / Android 的 cpp 农历模块,量程为 1900~2100 。

对于 iOS,还提供一个用 JSCore 直接调用 Calendar.js 的版本

功能

  • 支持 农历 转 公历
  • 支持 公历 转 农历
  • 支持 天干、地支 数据
  • 支持 24 节气
  • 支持 农历日期的中文显示

使用

C++

lunar = new Lunar();
LunarObj* obj = lunar->solar2lunar(2015, 3, 4);

obj >>>
lunarYear: 2015, 
lunarMonth: 1, 
lunarDay: 14, 
Animal: "羊"
lunarMonthChineseName: "正月"
lunarDayChineseName: "十四"
solarDay: 4
solarMonth: 3
solarYear: 2015
gzDay: "己卯"
gzMonth: "戊寅"
gzYear: "乙未"
isLeap: false
isTerm: false

其他方法请参考头文件注释、和 iOS 单元测试

Objective-C

TTLunarDate* lunarDate = [TTLunarCalendar convertFromGeneralDateYear: 2015
                                                               month: 3
                                                                 day: 4];
                                                                 
lunarDate Property 同 cpp

其他方法请参考头文件注释、和 iOS 单元测试,JSCore 版本对外接口一样。

Android

Todo

Todo

  • CocoaPod 支持
  • NDK 封装

lunarcalendar's People

Contributors

rpplusplus 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

Watchers

 avatar  avatar  avatar  avatar

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.