From d410b3c22486718b72a580125550f98e35ae7c69 Mon Sep 17 00:00:00 2001 From: Sergey Antropoff Date: Wed, 29 Jul 2026 21:58:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=B8=D0=BA=D0=BE=D0=BD=D0=BA=D0=B8=20=D0=B4=D0=B0=D1=82=D1=8B?= =?UTF-8?q?/=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8=20=C2=AB=D0=94?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=83=D0=BF=D0=BD=D0=BE=20=D1=81=C2=BB=20?= =?UTF-8?q?=D0=B2=20=D1=81=D1=82=D0=B8=D0=BB=D0=B5=20=D0=B3=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D0=B0=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/css/app.css | 19 ++++++++++++++++++- app/static/js/create.js | 19 +++++++++++++++++++ app/static/js/i18n.js | 2 ++ app/templates/create.html | 18 ++++++++++++++++-- 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/app/static/css/app.css b/app/static/css/app.css index bc6d418..f4c2ca9 100644 --- a/app/static/css/app.css +++ b/app/static/css/app.css @@ -300,8 +300,25 @@ html[data-theme="dark"] .icon-btn:hover { grid-template-columns: 1fr 1fr; gap: 0.45rem; } -.datetime-split input { +.datetime-split .input-with-action > input[type="date"], +.datetime-split .input-with-action > input[type="time"] { + width: 100%; min-width: 0; + padding-right: 2.75rem; + color-scheme: dark; +} +html[data-theme="light"] .datetime-split .input-with-action > input[type="date"], +html[data-theme="light"] .datetime-split .input-with-action > input[type="time"] { + color-scheme: light; +} +.datetime-split .input-with-action > input[type="date"]::-webkit-calendar-picker-indicator, +.datetime-split .input-with-action > input[type="time"]::-webkit-calendar-picker-indicator { + opacity: 0; + position: absolute; + right: 0; + width: 2.5rem; + height: 100%; + cursor: pointer; } .field-label { display: block; diff --git a/app/static/js/create.js b/app/static/js/create.js index 6cfa0de..3269dee 100644 --- a/app/static/js/create.js +++ b/app/static/js/create.js @@ -18,6 +18,8 @@ maxOpens: document.getElementById("max-opens"), availableFromDate: document.getElementById("available-from-date"), availableFromTime: document.getElementById("available-from-time"), + availableFromDateBtn: document.getElementById("available-from-date-btn"), + availableFromTimeBtn: document.getElementById("available-from-time-btn"), password: document.getElementById("password"), generatePassword: document.getElementById("generate-password"), dropzone: document.getElementById("dropzone"), @@ -595,6 +597,23 @@ els.password.select(); }); + function openPicker(input) { + if (!input) return; + try { + if (typeof input.showPicker === "function") { + input.showPicker(); + return; + } + } catch { + /* ignore */ + } + input.focus(); + input.click(); + } + + els.availableFromDateBtn?.addEventListener("click", () => openPicker(els.availableFromDate)); + els.availableFromTimeBtn?.addEventListener("click", () => openPicker(els.availableFromTime)); + if (window.WrappedI18n.onChange) { window.WrappedI18n.onChange(() => { fillTtl(); diff --git a/app/static/js/i18n.js b/app/static/js/i18n.js index 5295406..4d4601c 100644 --- a/app/static/js/i18n.js +++ b/app/static/js/i18n.js @@ -72,6 +72,8 @@ "create.maxOpensInvalid": "Invalid number of opens.", "create.availableFrom": "Available from (optional)", "create.availableFromHint": "Empty = available immediately", + "create.availableFromDate": "Pick date", + "create.availableFromTime": "Pick time", "create.availableFromPast": "Available-from must not be in the past.", "create.availableFromAfterExpiry": "Available-from must be before expiry.", "create.opensBadge": "{n} opens", diff --git a/app/templates/create.html b/app/templates/create.html index 9fa7480..255d388 100644 --- a/app/templates/create.html +++ b/app/templates/create.html @@ -40,8 +40,22 @@
Available from (optional)
- - +
+ + +
+
+ + +

Empty = available immediately