com.github.alvaro72:period

Support library to deal with time periods (Week, Year, Quarter, etc...).

License

License

GroupId

GroupId

com.github.alvaro72
ArtifactId

ArtifactId

period
Last Version

Last Version

0.9.35
Release Date

Release Date

Type

Type

jar
Description

Description

com.github.alvaro72:period
Support library to deal with time periods (Week, Year, Quarter, etc...).
Project URL

Project URL

https://github.com/alvaro72/period
Source Code Management

Source Code Management

https://github.com/alvaro72/period

Download period

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.alvaro72/period/ -->
<dependency>
    <groupId>com.github.alvaro72</groupId>
    <artifactId>period</artifactId>
    <version>0.9.35</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.alvaro72/period/
implementation 'com.github.alvaro72:period:0.9.35'
// https://jarcasting.com/artifacts/com.github.alvaro72/period/
implementation ("com.github.alvaro72:period:0.9.35")
'com.github.alvaro72:period:jar:0.9.35'
<dependency org="com.github.alvaro72" name="period" rev="0.9.35">
  <artifact name="period" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.alvaro72', module='period', version='0.9.35')
)
libraryDependencies += "com.github.alvaro72" % "period" % "0.9.35"
[com.github.alvaro72/period "0.9.35"]

Dependencies

test (1)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-engine jar 5.5.2

Project Modules

There are no modules declared in this project.

period

Java library for working with periods between dates.

Maven

For use with maven add this dependency.

    <dependency>
      <groupId>com.github.alvaro72</groupId>
      <artifactId>period</artifactId>
      <version>0.9.35</version>
    </dependency>

Examples

Create a Quarter:

Calendar cal = Calendar.getInstance();
cal.set(2018, 1, 31);
Quarter quarter = new Quarter(cal.getTime()); // First Quarter of 2018
Quarter nextQuarter = quarter.next();         // Second Quarter of 2018
Quarter previousQuarter = quarter.previous(); // Fourth Quarter of 2017

Create a Semester:

Calendar cal = Calendar.getInstance();
cal.set(2018, 1, 31);
Semester semester = new Semester(cal.getTime()); // First Semester of 2018
Semester nextSemester = semester.next();         // Second Semester of 2018
Semester previousSemester = semester.previous(); // Second Semester of 2017

Versions

Version
0.9.35
0.9.34
0.8.2