Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input_datetime formatted in 12H AM/PM, possible to have it formatted in 24H? #189

Closed
DJKalz opened this issue May 4, 2021 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@DJKalz
Copy link

DJKalz commented May 4, 2021

First of all this is a great addition to the entities card and is so much more powerful and useful, so thanks for the hard work and releasing it to the community!!

I’m having a slight issue with formatting when using this card when using the helpers input_datetime.

When I add the datetime helpers to the card it shows the datetime in 12H AM / PM format. I would like it to be displayed as HH:mm, in 24 hour format.

Here’s the code I’m using with a screenshot of what it displays, and thanks in advance for any help.

type: entities
title: Schedule 1
show_header_toggle: false
entities:
  - entity: input_boolean.day_1_1
    type: 'custom:multiple-entity-row'
    show_state: false
    state_color: true
    tap_action:
      action: none
    entities:
      - entity: input_boolean.day_1_1
        toggle: true
        name: false
      - entity: input_datetime.workday_1_1
        name: Work day
      - entity: input_number.workday_1_1
        name: °C
        format: precision0
      - entity: input_datetime.offday_1_1
        name: Off day
      - entity: input_number.offday_1_1
        name: °C
        format: precision0

image

PS, I don't think I can use a senor template and format it because I am using this card to also act as the input, when the user clicks on the field a window pops up which allows you to set the temperature.

@tobi-bo
Copy link

tobi-bo commented Nov 3, 2021

I think, the card should respect the time format in user settings:
image

But it seems, that this is ignored:
image

@benct benct added bug Something isn't working enhancement New feature or request labels Dec 14, 2021
@benct
Copy link
Owner

benct commented Dec 17, 2021

This card uses custom-card-helpers for formatting time values, which seem to not have implemented support for AM/PM yet. Would suggest making an issue there and they'll hopefully add it soon.

Edit: Seems they have added support, but not released the changes yet. Should hopefully be available soonish.

@benct benct removed the enhancement New feature or request label Dec 17, 2021
@benct
Copy link
Owner

benct commented Dec 23, 2021

Should (in theory) be fixed in version 4.4.0. Let me know if not.

@benct benct closed this as completed Dec 23, 2021
@ildar170975
Copy link

ildar170975 commented Dec 23, 2021

Unfortunately, values between 00:00 & 00:59 are displayed wrong:

  - type: entities
    entities:
      - input_datetime.test_datetime
      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: input_datetime.test_datetime
            name: time
        show_state: false

изображение

Found my old closed issue:
#198

@benct
Copy link
Owner

benct commented Dec 23, 2021

Currently using exactly the same function as HA uses for displaying datetime values. So not sure how to fix that :/

@ildar170975
Copy link

ildar170975 commented Dec 23, 2021

There is a frontend issue:
home-assistant/frontend#9379

iPad - shows correct time "00:59"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants