chore: release v1.5.0 (#67)

* chore: release v1.4.0

* feat: timezone-aware locale formatting

- Add TIMEZONE_TO_REGION map for 50+ timezones worldwide
- Combine app language with timezone region (e.g., en + Europe/Berlin → en-DE)
- Fix times displaying in wrong timezone (treated as UTC instead of local)
- Add parseLocalDateTime() to handle ISO strings without UTC conversion
- Users now get regional formatting (24h time, local date format) regardless of app language
- Swedish user with en-SE locale now gets yyyy-mm-dd format and 24h time
- German user with en-DE locale gets dd.mm.yyyy format and 24h time
- Add missing i18n translation key 'lastSent'
- Update all getSystemLocale() calls to pass app language parameter

* chore: release v1.5.0

* fix: timezone-independent test for CI (use 14:00 instead of 22:00)

* fix: make timezone test independent of server timezone
This commit is contained in:
Daniel Volz
2026-01-23 21:42:57 +01:00
committed by GitHub
parent 0a4f8c5948
commit 8e2fd0a761
26 changed files with 1830 additions and 108 deletions
+8 -7
View File
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { useAppContext } from "../context";
import { MedicationAvatar, MobileEditModal } from "../components";
import { useMedicationForm } from "../hooks";
import { formatNumber, formatDateTime } from "../utils/formatters";
import { formatNumber, formatDateTime, combineDateAndTime } from "../utils/formatters";
import { getPackageSize, FIELD_LIMITS } from "../types";
import type { Medication } from "../types";
@@ -32,6 +32,7 @@ export function MedicationsPage() {
const {
form,
setForm,
setOriginalForm,
editingId,
setEditingId,
formSaved,
@@ -153,6 +154,9 @@ export function MedicationsPage() {
// Reset form after successful save
if (!editingId) {
resetForm();
} else {
// Update originalForm so formChanged becomes false
setOriginalForm(form);
}
} catch (err) {
console.error("Save error:", err);
@@ -234,7 +238,7 @@ export function MedicationsPage() {
<div className="blister-list">
{med.blisters.map((s, idx) => (
<div key={`${med.id}-${idx}`} className="blister-row-simple">
{s.usage} {s.usage === 1 ? t('common.pill') : t('common.pills')} · {t('form.blisters.every')} {s.every} {s.every === 1 ? t('common.day') : t('common.days')} · {t('form.blisters.from')} {formatDateTime(s.start, i18n.language)}
{s.usage} {s.usage === 1 ? t('common.pill') : t('common.pills')} · {t('form.blisters.every')} {s.every} {s.every === 1 ? t('common.day') : t('common.days')} · {t('form.blisters.from')} {formatDateTime(s.start)}
</div>
))}
</div>
@@ -480,7 +484,7 @@ export function MedicationsPage() {
</button>
)}
<button type="submit" disabled={saving || hasValidationErrors || (!formChanged && (formSaved || !!editingId))}>
{saving ? t('common.saving') : formSaved && !formChanged ? t('common.saved') : t('common.save')}
{formSaved && !formChanged ? t('common.saved') : t('common.save')}
</button>
</div>
</form>
@@ -524,7 +528,4 @@ export function MedicationsPage() {
);
}
// Helper function to combine date and time into ISO datetime with Z suffix
function combineDateAndTime(date: string, time: string): string {
return `${date}T${time}:00.000Z`;
}