From d7f4c30a083b0dd81ff05898eeaf6bfde708774f Mon Sep 17 00:00:00 2001 From: Morten Haraldsen Date: Mon, 29 Jan 2024 18:12:42 +0100 Subject: [PATCH] Cleanup --- src/main/java/com/ethlo/time/DateTime.java | 5 ----- src/main/java/com/ethlo/time/internal/EthloITU.java | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/ethlo/time/DateTime.java b/src/main/java/com/ethlo/time/DateTime.java index 66fcfac..b5fa79c 100644 --- a/src/main/java/com/ethlo/time/DateTime.java +++ b/src/main/java/com/ethlo/time/DateTime.java @@ -210,11 +210,6 @@ private static void leapSecondCheck(int year, int month, int day, int hour, int } } - public static DateTime ofNanos(int year, int month, int day, int hour, int minute, int second, int nanos, TimezoneOffset timezoneOffset, int fractionDigits, int charLength) - { - return new DateTime(fractionDigits > 0 ? Field.NANO : Field.SECOND, year, month, day, hour, minute, second, nanos, timezoneOffset, fractionDigits, charLength); - } - /** * Returns if the specified field is part of this date/date-time * diff --git a/src/main/java/com/ethlo/time/internal/EthloITU.java b/src/main/java/com/ethlo/time/internal/EthloITU.java index c1aed86..89ce857 100644 --- a/src/main/java/com/ethlo/time/internal/EthloITU.java +++ b/src/main/java/com/ethlo/time/internal/EthloITU.java @@ -309,7 +309,7 @@ private static DateTime handleFractionalSeconds(int offset, ParseConfig parseCon final TimezoneOffset timezoneOffset = parseTimezone(offset, parseConfig, chars, idx); final int charLength = (idx + (timezoneOffset != null ? timezoneOffset.getRequiredLength() : 0)) - offset; final int second = parsePositiveInt(chars, offset + 17, offset + 19); - return DateTime.ofNanos(year, month, day, hour, minute, second, nanos, timezoneOffset, fractionDigits, charLength); + return new DateTime(Field.NANO, year, month, day, hour, minute, second, nanos, timezoneOffset, fractionDigits, charLength); } private static void assertFractionDigits(String chars, int fractionDigits, int idx)