Coder Social home page Coder Social logo

peradnya / balinese-date-java-lib Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 193 KB

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

License: Apache License 2.0

Java 100.00%
java library saka bali date calendar kalender open-source

balinese-date-java-lib's Introduction

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.

balinese-date-java-lib's People

Contributors

peradnya avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.