Skip to content
The-Lukashian-CalendarPublic

About

Java Reference Implementation of The Lukashian Calendar

Resources

Stars

11 stars

Watchers

2 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is the Java Reference Implementation of The Lukashian Calendar, a calendar that is exceptionally simple, highly accurate and radically different. It provides a universal mechanism for every planet, moon or space station that we'll ever inhabit and is perfect for the upcoming Mars Settlement.

For the artifacts, please visit the Maven Central.

For more information on the calendar mechanism itself, please visit lukashian.org.

 

How to use the Lukashian Calendar

Using the Lukashian Calendar is easy. First, add the most recent version of the jar file as a dependency. Then, you can simply use the org.lukashian.Instant, org.lukashian.Day and org.lukashian.Year classes like you're used to. For example, to get the current time, use Instant.now(). Please see the Javadoc for full documentation on these classes.

Formatting

Use the org.lukashian.Formatter class to format Instants, Days and Years. Please see the Javadoc for all available formatting options.

Using different calendar instances

By default, the Lukashian Calendar uses the instance for Planet Earth. However, because the Lukashian Calendar mechanism makes no assumptions about how long days and years are, or how many days a year should have, it works universally for every planet, moon or space station. In addition to the instance for Planet Earth, an instance for Planet Mars is available as well.

Using a different calendar instance can be done in one of two ways. First, you could use the instantiators of Instant, Day and Year that take a calendar key as a parameter (for example, the of, ofEpoch or now methods). For the various calendar keys that are available, please see CalendarKeys. For example, to instantiate the current Instant on Planet Mars, use Instant.now(CalendarKeys.MARS).

The second way to use a different calendar instance, is to set the default calendar instance to a different value. Calling MillisecondStore.store().setDefaultCalendarKey(CalendarKeys.MARS) will cause all subsequent instantiatiors of Instant, Day and Year that don't explicitly specify a calendar key, to use the instance of Planet Mars.

It is also possible to create your own calendar instance. Please see the Javadoc of the MillisecondStore and MillisecondStoreDataProvider classes for more details.

Loading calendar instances from an external resource

In order to facilitate central maintenance and governance of the official numbers that define an instance of the Lukashian Calendar, the ExternalResourceMillisecondStoreDataProvider can load instances from external resources.

The FileMillisecondStoreDataProvider and HttpMillisecondStoreDataProvider provide functionality for loading instances via files or HTTP URL's, respectively. The StandardEarthHttpMillisecondStoreDataProvider and StandardMarsHttpMillisecondStoreDataProvider load the instance for Planet Earth or Planet Mars directly from the official lukashian.org server.

Please see the Javadoc for full documentation on these classes.

Ports to other languages

Because of this external loading mechanism, ports of the Lukashian Calendar in other programming languages only need to port the ExternalResourceMillisecondStoreDataProvider and its subclasses, not the implementations of MillisecondStoreDataProvider that perform the actual calculations, as the results of these calculations will also be loadable from the official lukashian.org server.

 

Changelog

Please refer to the Maven Central for the release date and artifacts of each version.

1.15.0:

  • Added various parameter validation checks in the code
  • Registering a MillisecondStoreDataProvider under a certain key now clears the previously stored data for that key
  • Conversion of an Instant that takes place during a UNIX leap second from one calendar instance to another is no longer affected by said leap second
  • Improved Javadoc documentation

1.14.0:

  • Improved Equation of Time calculation of Earth instance (StandardEarthMillisecondStoreDataProvider)

1.13.0:

  • Revamped the MillisecondStore mechanism, enabling the usage of multiple simultaneous implementations of MillisecondStoreDataProvider
  • Added a calendar instance for Planet Mars, via StandardMarsMillisecondStoreDataProvider and StandardMarsHttpMillisecondStoreDataProvider
  • Added additional Formatter.format() methods
  • Switched from Java 21 LTS to Java 25 LTS
  • Updated versions of dependencies

1.12.0:

  • Added method Day.getLengthOfBeepInMilliseconds()
  • Added mechanism for loading instances of the Lukashian Calendar from external resources, specifically, the ExternalResourceMillisecondStoreDataProvider, FileMillisecondStoreDataProvider, HttpMillisecondStoreDataProvider and StandardEarthHttpMillisecondStoreDataProvider classes

1.11.0:

  • Improved Javadoc documentation
  • Updated versions of dependencies

1.10.0:

  • Created this changelog
  • Added methods Day.plusYears(), Day.minusYears(), Instant.plusYears() and Instant.minusYears()
  • Added methods Year.containsNot(), Day.containsNot(), Day.isNotIn(), Instant.isNotIn()
  • Added method MillisecondStore.setMillisecondStoreDataProvider() that allows changing the MillisecondStoreDataProvider on the fly
  • Switched from java.lang.BigDecimal to org.apache.commons.numbers.fraction.BigFraction for Instant calculations, because BigDecimal did not provide the required accuracy
  • Switched from Java 17 LTS to Java 21 LTS
  • Various small improvements and optimizations

1.9.0 and before:

  • The Lukashian Calendar did not maintain a changelog on GitHub yet...

About

Java Reference Implementation of The Lukashian Calendar

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages