Skip to content

Bug: side hours aren't formatted to 24 hours  #497

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

Events get formatted fine, but not side hours:

image

Also, I've noticed that the library uses some constant ways to show the time formatting, by checking if the system uses 24 hours or not. That's not the best way to do it.

The correct way to do it is by getting the OS format alone :

/**
 * gets the default time formatter of the device
 */
@JvmStatic
fun getFormatTimeUsingDeviceSettings(context: Context, useUtc: Boolean): java.text.DateFormat {
    return (DateFormat.getTimeFormat(context)
            ?: SimpleDateFormat("HH:mm", Locale.getDefault()))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions