1 {% extends
"base.html" %}
3 {% block title %}{{ _(
"Publish %s") % post.title }}{% end block %}
7 <div class=
"card-body">
8 <h5 class=
"card-title mb-1">{{ _(
"Publish Post") }}
</h5>
9 <h6 class=
"card-subtitle text-muted mb-3">{{ post.title }}
</h6>
11 <form action=
"" method=
"POST">
12 {% raw xsrf_form_html() %}
14 <input type=
"hidden" name=
"when">
17 <label class=
"form-label">{{ _(
"Time to Publish") }}
</label>
19 <input type=
"datetime-local" class=
"form-control"
20 pattern=
"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}" required
>
23 <div class=
"d-grid gap-2">
24 <button type=
"submit" class=
"btn btn-primary">{{ _(
"Publish") }}
</button>
25 <a class=
"btn btn-secondary" href=
"/post/{{ post.slug }}">{{ _(
"Cancel") }}
</a>
32 {% block javascript %}
33 <script type=
"text/javascript">
34 $(document).ready(function() {
35 var when = $(
"input[name='when']");
37 $(
"input[type='datetime-local']").on(
"change keyup", function(event) {
38 var value = $(this).val();
40 // Parse date and format with timezone
42 var date = new Date(value);
43 value = date.toISOString();