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">
16 <div class=
"form-group">
17 <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 <button type=
"submit" class=
"btn btn-primary btn-block">{{ _(
"Publish") }}
</button>
24 <a class=
"btn btn-secondary btn-block" href=
"/post/{{ post.slug }}">{{ _(
"Cancel") }}
</a>
30 {% block javascript %}
31 <script type=
"text/javascript">
32 $(document).ready(function() {
33 var when = $(
"input[name='when']");
35 $(
"input[type='datetime-local']").on(
"change keyup", function(event) {
36 var value = $(this).val();
38 // Parse date and format with timezone
40 var date = new Date(value);
41 value = date.toISOString();