mirror of
https://github.com/gabehf/tempus.git
synced 2026-03-16 18:55:57 -07:00
feat: added release date and original release date to album notes, if available
This commit is contained in:
parent
e84f62220c
commit
54a4355793
5 changed files with 62 additions and 20 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue