feat: added release date and original release date to album notes, if available

This commit is contained in:
CappielloAntonio 2024-06-02 20:19:18 +02:00
parent e84f62220c
commit 54a4355793
5 changed files with 62 additions and 20 deletions

View file

@ -3,6 +3,9 @@ package com.cappielloantonio.tempo.subsonic.models
import android.os.Parcelable
import androidx.annotation.Keep
import kotlinx.parcelize.Parcelize
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
@Keep
@Parcelize
@ -10,4 +13,13 @@ open class ItemDate : Parcelable {
var year: Int? = null
var month: Int? = null
var day: Int? = null
fun getFormattedDate(): String {
val calendar = Calendar.getInstance()
val dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.getDefault())
calendar.set(year ?: 0, month ?: 0, day ?: 0)
return dateFormat.format(calendar.time)
}
}