Skip to content

Commit b2bce8d

Browse files
feat(endpoint-posts): keep radio options when editing published date
Prevents published date being updated upon removal of milliseconds from published with post update.
1 parent a48a039 commit b2bce8d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

packages/endpoint-posts/views/post-form.njk

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
name: "publication-date",
3838
values: fieldData("publication-date").value,
3939
items: [{
40-
label: __("posts.form.published.now"),
40+
label: __("posts.form.published.now") if postStatus !== "published" else fieldData("published").value | date("PPPppp", { locale: opts.locale }),
4141
value: "now",
4242
checked: true
4343
}, {
@@ -50,13 +50,7 @@
5050
label: __("posts.form.published.label")
5151
})
5252
}]
53-
}) if postStatus !== "published" else input({
54-
classes: "input--width-10",
55-
name: "published",
56-
value: fieldData("published").value | localDate(application.timeZone),
57-
type: "datetime-local",
58-
label: __("posts.form.published.label")
59-
}) | indent(4) }}
53+
}) }}
6054

6155
{{ radios({
6256
inline: true,

0 commit comments

Comments
 (0)