Skip to content
Snippets Groups Projects
Commit 185ce4a1 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 20792640
Branches
No related tags found
1 merge request!39Bug 40050 01
......@@ -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)}"
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment