Skip to content

Commit bfaeec0

Browse files
committed
date formatter fixes
1 parent 6fd843a commit bfaeec0

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.eldhopj.kotlin_extensions.utils.formatter
22

33
import java.util.Date
4+
import org.jetbrains.annotations.NotNull
45

56
internal interface Formatter {
67

@@ -10,15 +11,15 @@ internal interface Formatter {
1011
* @param date {@link Date} object
1112
* @param pattern Pattern to format(e.g, yyyy-MM-dd)
1213
*/
13-
fun format(date: Date, pattern: String): String
14+
fun format(@NotNull date: Date?, @NotNull pattern: String): String
1415

1516
/**
1617
* Formats the given date object to the specified pattern
1718
*
1819
* @param date string date value
1920
* @param pattern Pattern to which the date follows(e.g, yyyy-MM-dd)
2021
*/
21-
fun format(date: String, pattern: String): Date?
22+
fun format(@NotNull date: String, @NotNull pattern: String): Date?
2223

2324
/**
2425
* Formats the given date object to the specified pattern
@@ -27,6 +28,10 @@ internal interface Formatter {
2728
* @param fromPattern Pattern to which the date follows(e.g, yyyy-MM-dd)
2829
* @param toPattern Pattern to format(e.g, yyyy-MM-dd)
2930
*/
30-
fun format(date: String, fromPattern: String, toPattern: String): String
31+
fun format(
32+
@NotNull date: String,
33+
@NotNull fromPattern: String,
34+
@NotNull toPattern: String
35+
): String
3136

3237
}

app/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ dependencies {
3939
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
4040
testImplementation 'junit:junit:4.13.2'
4141
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
42-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
4342

4443
implementation project(':Kotlin_extensions')
4544
}

jitpack.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
jdk:
22
- openjdk11
3+
before_install:
4+
- ./scripts/prepareJitpackEnvironment.sh

0 commit comments

Comments
 (0)