Skip to content

Repository files navigation

BalineseDate Java Library

build version pipeline status coverage report

Introduction

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.

Features

BalineseDate is designed to be immutable and thread-safe. BalineseDate have several features like:

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)

Import BalineseDate into Your Project

BalineseDate Java Library use Jitpack to publish the binary. Choose one of these following method:

Direct Download

Gradle

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'
}

Maven

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>

Documentation

How to Build

Requirement

The recomended requirement to build this project are:

  1. Latest Oracle Java JDK (Recomended >= 7.x)
  2. Latest Gradle (Recomended >= 4.9.0)
  3. Latest Git Client

for Gradle installation, you can follow the Gradle installation instuction.

Building JAR File

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

Building Documentation (Javadoc)

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 & Checking

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

Using in Code

Creating BalineseDate Object

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);

Using BalineseDate Method

// 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);

Related Project

There is another related project about Balinese Saka Calendar:

References

  • 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.

About

BalineseDate is a open source library to develop Balinese Saka Calendar (Kalender Bali) in Java.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages