mirego/trikot.foundation

Support Date creation from components (year, month, day, hour, minutes, etc)

Closed this issue · 1 comments

Currently, we can only create a Date instance using 3 methods :

  1. val now: Date
  2. fun fromISO8601(isoDate: String): Date
  3. fun fromEpochMillis(epoch: Long): Date

That would be great if we could create a date from datetime components, such as this example :

fun fromComponents(
     year: String, // YYYY
     month: String, // MM
     day: String // DD,
     hours: String = "00", // HH
     minutes: String = "00", // MM
     seconds: String = "00", // SS
): Date

This new method could itself format a ISO-8601 compliant string a reuse fromISO8601 under the hood.