Skip to content

Commit

Permalink
Fix some javadoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Haraldsen committed Dec 28, 2023
1 parent 1860d8c commit a8be21a
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions src/main/java/com/ethlo/time/DateTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ public DateTime(final Field field, final int year, final int month, final int da

/**
* Create a new instance with second granularity from the input parameters
*
* @param year year
* @param month month
* @param day day
* @param hour hour
* @param minute minute
* @param second second
* @param offset timezone offset
* @return A DateTime with second granularity
*/
public static DateTime of(int year, int month, int day, int hour, int minute, int second, TimezoneOffset offset)
{
Expand All @@ -76,6 +85,15 @@ public static DateTime of(int year, int month, int day, int hour, int minute, in

/**
* Create a new instance with nanosecond granularity from the input parameters
*
* @param year year
* @param month month
* @param day day
* @param hour hour
* @param minute minute
* @param second second
* @param offset timezone offset
* @return A DateTime with nanosecond granularity
*/
public static DateTime of(int year, int month, int day, int hour, int minute, int second, int nanos, TimezoneOffset offset, final int fractionDigits)
{
Expand All @@ -84,6 +102,8 @@ public static DateTime of(int year, int month, int day, int hour, int minute, in

/**
* Create a new instance with year granularity from the input parameters
* @param year The year
* @return a new instance with year granularity from the input parameters
*/
public static DateTime ofYear(int year)
{
Expand All @@ -92,26 +112,40 @@ public static DateTime ofYear(int year)

/**
* Create a new instance with year-month granularity from the input parameters
* @param year The year
* @param month The month
* @return a new instance with year-month granularity from the input parameters
*/
public static DateTime ofYearMonth(int years, int months)
public static DateTime ofYearMonth(int year, int month)
{
return new DateTime(Field.MONTH, years, months, 0, 0, 0, 0, 0, null, 0);
return new DateTime(Field.MONTH, year, month, 0, 0, 0, 0, 0, null, 0);
}

/**
* Create a new instance with day granularity from the input parameters
* @param year The year
* @param month The month
* @param day The day
* @return a new instance with day granularity from the input parameters
*/
public static DateTime ofDate(int years, int months, int days)
public static DateTime ofDate(int year, int month, int day)
{
return new DateTime(Field.DAY, years, months, days, 0, 0, 0, 0, null, 0);
return new DateTime(Field.DAY, year, month, day, 0, 0, 0, 0, null, 0);
}

/**
* Create a new instance with minute granularity from the input parameters
* @param year The year
* @param month The month
* @param day The day
* @param hour The hour
* @param minute The minute
* @param offset The timezone offset
* @return a new instance with minute granularity from the input parameters
*/
public static DateTime of(int years, int months, int days, int hours, int minute, TimezoneOffset offset)
public static DateTime of(int year, int month, int day, int hour, int minute, TimezoneOffset offset)
{
return new DateTime(Field.MINUTE, years, months, days, hours, minute, 0, 0, offset, 0);
return new DateTime(Field.MINUTE, year, month, day, hour, minute, 0, 0, offset, 0);
}

/**
Expand Down

0 comments on commit a8be21a

Please sign in to comment.