Skip to content

loonggg/LunarCalendar

Repository files navigation

LunarCalendar

日期转农历

例子和效果图

使用方法

Step 1. Add the JitPack repository to your build file

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

	dependencies {
	        compile 'com.github.loonggg:LunarCalendar:v1.0'
	}

Step 3. Used in the code

    //获取农历
    Log.i("农历", LunarCalendar.getLunarYearMonthDay(2017, 5, 27));
    //只获取农历的年份
    Log.i("农历", LunarCalendar.getLunarYear(2017, 5, 27, true));
    Log.i("农历", LunarCalendar.getLunarYear(2017, 5, 27, false));
    //只获取农历的月日
    Log.i("农历", LunarCalendar.getLunarMonthDay(2017, 5, 27));
    //只获取农历的生肖
    Log.i("农历", LunarCalendar.getLunarAnimal(2017, 5, 27));

公众号

欢迎大家关注我的微信公众号:非著名程序员(smart_android),更多好的原创文章均首发于微信订阅号:非著名程序员

License

Copyright 2016 loonggg

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

日历转农历

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages