Skip to content

Commit

Permalink
date formatter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eldhopj committed Apr 24, 2022
1 parent 6fd843a commit bfaeec0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.eldhopj.kotlin_extensions.utils.formatter

import java.util.Date
import org.jetbrains.annotations.NotNull

internal interface Formatter {

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

/**
* Formats the given date object to the specified pattern
*
* @param date string date value
* @param pattern Pattern to which the date follows(e.g, yyyy-MM-dd)
*/
fun format(date: String, pattern: String): Date?
fun format(@NotNull date: String, @NotNull pattern: String): Date?

/**
* Formats the given date object to the specified pattern
Expand All @@ -27,6 +28,10 @@ internal interface Formatter {
* @param fromPattern Pattern to which the date follows(e.g, yyyy-MM-dd)
* @param toPattern Pattern to format(e.g, yyyy-MM-dd)
*/
fun format(date: String, fromPattern: String, toPattern: String): String
fun format(
@NotNull date: String,
@NotNull fromPattern: String,
@NotNull toPattern: String
): String

}
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation project(':Kotlin_extensions')
}
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
jdk:
- openjdk11
before_install:
- ./scripts/prepareJitpackEnvironment.sh

0 comments on commit bfaeec0

Please sign in to comment.