Commit 296728a2 authored by Georg Koppen's avatar Georg Koppen Committed by Matthew Finkel
Browse files

Bug 40067: Fix reproducibility issue in classes2.dex

We make sure our MOZ_BUILD_DATE gets used as a source for showing date
related information on the Fenix about page.
parent 06b8d89d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -38,7 +38,14 @@ object Config {

    @JvmStatic
    fun generateBuildDate(): String {
        val dateTime = LocalDateTime.now()
        val dateTime = if (System.getenv("MOZ_BUILD_DATE") != null) {
          // Converting our MOZ_BUILD_DATE to LocalDateTime
          val format = SimpleDateFormat("yyyyMMddHHmmss", Locale.US)
          val date = format.parse(System.getenv("MOZ_BUILD_DATE"))
          java.sql.Timestamp(date.getTime()).toLocalDateTime()
        } else {
          LocalDateTime.now()
        }
        val timeFormatter = DateTimeFormatter.ofPattern("h:mm a")

        return "${dateTime.dayOfWeek.toString().toLowerCase().capitalize()} ${dateTime.monthValue}/${dateTime.dayOfMonth} @ ${timeFormatter.format(dateTime)}"