mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix missing range labels in date-range-picker (#18274)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
96fbd8aefb
commit
d992b2d40b
@ -60,7 +60,7 @@ export class HaDateRangePicker extends LitElement {
|
|||||||
|
|
||||||
@property() private _openingDirection = "right";
|
@property() private _openingDirection = "right";
|
||||||
|
|
||||||
protected willUpdate() {
|
protected willUpdate(changedProps: PropertyValues) {
|
||||||
// set dialog opening direction based on position
|
// set dialog opening direction based on position
|
||||||
const datePickerPosition = this.getBoundingClientRect().x;
|
const datePickerPosition = this.getBoundingClientRect().x;
|
||||||
if (datePickerPosition > (2 * window.innerWidth) / 3) {
|
if (datePickerPosition > (2 * window.innerWidth) / 3) {
|
||||||
@ -71,7 +71,11 @@ export class HaDateRangePicker extends LitElement {
|
|||||||
this._openingDirection = "center";
|
this._openingDirection = "center";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.hasUpdated && this.ranges === undefined) {
|
if (
|
||||||
|
(!this.hasUpdated && this.ranges === undefined) ||
|
||||||
|
(changedProps.has("hass") &&
|
||||||
|
this.hass?.localize !== changedProps.get("hass")?.localize)
|
||||||
|
) {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const weekStartsOn = firstWeekdayIndex(this.hass.locale);
|
const weekStartsOn = firstWeekdayIndex(this.hass.locale);
|
||||||
const weekStart = calcDate(
|
const weekStart = calcDate(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user