BalineseDate is an open source library to build Balinese Saka Calendar in Java based application.
Note: This library is in Beta Phase, the API may change without notice.
BalineseDate is designed to be immutable and thread-safe. BalineseDate have several features like:
- Pawukon
- Pawewaran
- Paringkelan
- Eka Jala Rsi (v0.3.0)
- Pratithi Samut Pada (v0.3.0)
- Dewasa (v0.5.0)
- Sasih
- Pawukon/Penanggal and Nguna Ratri.
- Pengalantaka Eka Sungsang Pon (before 2000) & Paing (2000 and after)
- Malamasa (< 1993), Sasih Kesinambungan (1993 - 2002), Nampih Sasih (>= 2003)
- Saka Year
BalineseDate also have several utilities that can be use by developer like:
- Filter BalineseDate(s) from selected Date (v0.2.0)
- Filter BalineseDate(s) from selected BalineseDate List (v0.4.0)
BalineseDate Java Library use Jitpack to publish the binary. Choose one of these following method:
- balinese-date-java-lib-0.4.0.jar
- balinese-date-java-lib-0.4.0-javadoc.jar
- balinese-date-java-lib-0.4.0-sources.jar
Please add the repository of Jitpack in the build.gradle
of your project
repositories {
...
jcenter()
maven { url 'https://jitpack.io' }
}
and then, add dependency to BalineseDate Library in the build.gradle
dependencies {
implementation 'com.gitlab.peradnya:balinese-date-java-lib:0.4.0'
}
Please add the repository of Jitpack in the pom.xml
of your project
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
and then, add dependency to BalineseDate Library in the pom.xml
<dependency>
<groupId>com.gitlab.peradnya</groupId>
<artifactId>balinese-date-java-lib</artifactId>
<version>0.4.0</version>
</dependency>
The recomended requirement to build this project are:
- Latest Oracle Java JDK (Recomended >= 7.x)
- Latest Gradle (Recomended >= 4.9.0)
- Latest Git Client
for Gradle installation, you can follow the Gradle installation instuction.
JAR file of BalineseDate Library can be built by run the following command:
[project root]$ gradle build
You can find the compiled JAR at:
[project root]/build/libs/balinese-date-java-lib-[version].jar
Documentation of BalineseDate Library can be built by run the following command:
[project root]$ gradle javadoc
You can find the documentation at:
[project root]/build/docs/javadoc/index.html
Testing and checking of BalineseDate Library can be done by run the following command:
[project root]$ gradle check
You can find the test results at:
# JUnit (Unit Test) Result
[project root]/build/reports/tests/test/index.html
# Jacoco (Coverage) Result
[project root]/build/reports/jacoco/test/html/index.html
import peradnya.libs.balinesedate.*;
import java.util.GregorianCalendar;
// get current balinese date
BalineseDate now = new BalineseDate();
// get balinese date at 1 January 1969 using GregorianCalendar
GregorianCalendar date = new GregorianCalendar(1969,0,1);
BalineseDate bDate1 = new BalineseDate(date);
// get the sasih day (1 - 15)
// if number of element inside date = 1, then bDate1 is normal day
// if number of element inside date = 2, then bDate1 is ngunaratri day
List<Integer> date = bDate1.sasihDay();
// get sasih day info (penanggal, pangelong, tilem, or purnama)
SasihDayInfo sasihDayInfo = bDate1.sasihDayInfo();
// get BalineseDate(s) Between 2017-01-01 and 2017-12-31 with Wuku Watugunung and Pancawara Kliwon
GregorianCalendar start = new GregorianCalendar(2017,0,1);
GregorianCalendar finish = new GregorianCalendar(2017,11,31);
BalineseDateUtil.Filter q = new BalineseDateUtil.Filter();
q.wuku = Wuku.WATUGUNUNG;
q.pancaWara = PancaWara.KLIWON;
List<BalineseDate> result = BalineseDateUtil.filterByDateRange(q, start, finish);
There is another related project about Balinese Saka Calendar:
- Saka Calendar 2.0 by Edy Santosa.
- Ardhana, I.B.S. (2005). "Pokok-Pokok Wariga". Surabaya : Paramita.
- babadbali.com (Yayasan Bali Galang) for wewaran and paringkelan algorithm.
- Pendit, Nyoman. (2001). "Nyepi: kebangkitan, toleransi, dan kerukunan". Jakarta : Gramedia. Retrieved at google book.
- kalenderbali.org and kalenderbali.info for validation and building sample test-cases.