1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00
SmartCoder fcf844cf1a Fix issue #28896: "Last 12 months" in the Datetime Picker selects last year (#28902)
Summary of the fix:
The Problem:
now-12m was selecting the calendar year (Jan 1st to Dec 31st) instead of the last 12 months from now
It used startOfMonth and endOfMonth, which snap to month boundaries
The Solution:
Changed to match the now-7d and now-30d pattern
Now uses subMonths(today, 12) for start and subMonths(today, 0) (which equals today) for end
This gives exactly the last 12 months (365/366 days) ending at the current time
The Fix:
// Before (WRONG):calcDate(subMonths(today, 12), startOfMonth, ...)  // Jan 1st of 12 months agocalcDate(subMonths(today, 1), endOfMonth, ...)     // Dec 31st of last month// After (CORRECT):calcDate(today, subMonths, hass.locale, hass.config, 12)  // 12 months ago from nowcalcDate(today, subMonths, hass.locale, hass.config, 0)   // now
2026-01-12 11:53:08 +00:00
2025-04-28 16:04:47 +03:00
2025-11-26 13:02:35 +01:00
2025-12-19 19:52:31 +01:00
2025-12-11 14:14:27 +02:00
2025-12-15 14:56:48 +02:00
2026-01-09 17:41:54 +00:00
2025-12-29 12:41:19 +00:00
2024-09-30 17:10:45 +02:00
2025-10-09 20:26:31 +02:00
2025-01-14 11:24:02 +01:00
2026-01-09 17:41:54 +00:00

Home Assistant Frontend

This is the repository for the official Home Assistant frontend.

Screenshot of the frontend

Development

  • Initial setup: script/setup
  • Development: Instructions
  • Production build: script/build_frontend
  • Gallery: cd gallery && script/develop_gallery
  • Supervisor: Instructions

Frontend development

Classic environment

A complete guide can be found at the following link. It describes a short guide for the build of project.

License

Home Assistant is open-source and Apache 2 licensed. Feel free to browse the repository, learn and reuse parts in your own projects.

We use BrowserStack to test Home Assistant on a large variety of devices.

Home Assistant - A project from the Open Home Foundation

Languages
TypeScript 98.8%
JavaScript 1.1%