Skip to content

Hour formatting is without '0' in front of the hour #56

Open
@davideas

Description

@davideas

Bug description

DatePicker for TimeView when type="time"

In the class MatCalendarHeader in updateValues() the formatting for the hour is ignoring the double digit: it doesn't display the 0 in front of the hour!
this._hourButtonText = hours.toString(); --> any hour < 10 has only 1 digit

Expected behavior

Hour button text should have 0 for hour < 10, example => 06 instead of 6.
Could you please fix it as you do for the minutes? like this:
this._hourButtonText = ('00' + hours).slice(-2);

Screenshots

image

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