Adds build date to the about page
parent
7531bc56f2
commit
2e525813f6
|
@ -186,6 +186,9 @@ android.applicationVariants.all { variant ->
|
||||||
} else {
|
} else {
|
||||||
buildConfigField 'boolean', 'TELEMETRY', 'false'
|
buildConfigField 'boolean', 'TELEMETRY', 'false'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def buildDate = Config.generateBuildDate()
|
||||||
|
buildConfigField 'String', 'BUILD_DATE', '"' + buildDate + '"'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normally this should use the same version as the glean dependency. But since we are currently using AC snapshots we
|
// Normally this should use the same version as the glean dependency. But since we are currently using AC snapshots we
|
||||||
|
|
|
@ -10,6 +10,7 @@ import android.content.Context
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import androidx.annotation.RawRes
|
import androidx.annotation.RawRes
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
|
import org.mozilla.fenix.BuildConfig.BUILD_DATE
|
||||||
import org.mozilla.fenix.ext.replace
|
import org.mozilla.fenix.ext.replace
|
||||||
import org.mozilla.geckoview.BuildConfig
|
import org.mozilla.geckoview.BuildConfig
|
||||||
|
|
||||||
|
@ -33,6 +34,8 @@ object AboutPage {
|
||||||
// Nothing to do if we can't find the package name.
|
// Nothing to do if we can't find the package name.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
substitutionMap["%build-date%"] = BUILD_DATE
|
||||||
|
|
||||||
context.resources.getString(R.string.about_content, appName).also { content ->
|
context.resources.getString(R.string.about_content, appName).also { content ->
|
||||||
substitutionMap["%about-content%"] = content
|
substitutionMap["%about-content%"] = content
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,5 +45,7 @@ h1#wordmark {
|
||||||
<h1 id="wordmark">Fenix</h1>
|
<h1 id="wordmark">Fenix</h1>
|
||||||
<p class="subtitle">%about-version%</p>
|
<p class="subtitle">%about-version%</p>
|
||||||
%about-content%
|
%about-content%
|
||||||
|
|
||||||
|
<p class="subtitle">Built on: %build-date%</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
|
import java.time.LocalDateTime
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
|
@ -24,4 +26,12 @@ object Config {
|
||||||
// sections we use in the changelog (weeks).
|
// sections we use in the changelog (weeks).
|
||||||
return SimpleDateFormat(".yyww", Locale.US).format(today)
|
return SimpleDateFormat(".yyww", Locale.US).format(today)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun generateBuildDate(): String {
|
||||||
|
val dateTime = LocalDateTime.now()
|
||||||
|
val timeFormatter = DateTimeFormatter.ofPattern("h:mm a")
|
||||||
|
|
||||||
|
return "${dateTime.dayOfWeek.toString().toLowerCase().capitalize()} ${dateTime.monthValue}/${dateTime.dayOfMonth} @ ${timeFormatter.format(dateTime)}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue