mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
fix: snapshot single-digit week is not shown with 0 padded
This commit is contained in:
@@ -117,7 +117,7 @@ data class Snapshot(var revision: Int) {
|
|||||||
private var bytes = byteArrayOf()
|
private var bytes = byteArrayOf()
|
||||||
|
|
||||||
internal fun update() {
|
internal fun update() {
|
||||||
string = "${year}w${week}${Char(0x61 + revision)}"
|
string = "${year}w${week.toString().padStart(2,'0')}${Char(0x61 + revision)}"
|
||||||
bytes = byteArrayOf(
|
bytes = byteArrayOf(
|
||||||
revision.and(4).shl(7).or(year.and(127)).toByte(),
|
revision.and(4).shl(7).or(year.and(127)).toByte(),
|
||||||
week.shl(2).or(revision.and(3)).toByte()
|
week.shl(2).or(revision.and(3)).toByte()
|
||||||
|
|||||||
Reference in New Issue
Block a user