Added custom date (reason: firefox never love date inputs)

This commit is contained in:
2017-09-12 15:41:47 +07:00
parent 5b1b546dc5
commit e72205ff09
4 changed files with 127 additions and 6 deletions

View File

@@ -94,7 +94,7 @@
<label for="valid_at">Berlaku dari: </label>
</div>
<div class="stack">
<input type="date" name="valid_at" value="{{ post.valid_at }}">
<input id="left" name="valid_at" value="{{ post.valid_at }}">
</div>
<input type="hidden" name="old_valid_at" value="{{ post.valid_at }}">
</div>
@@ -104,7 +104,7 @@
<label for="expired_at">Berlaku sampai: </label>
</div>
<div class="stack">
<input type="date" name="expired_at" value="{{ post.expired_at }}">
<input id="right" name="expired_at" value="{{ post.expired_at }}">
</div>
<input type="hidden" name="old_expired_at" value="{{ post.expired_at }}">
</div>
@@ -148,6 +148,16 @@
</div>
{% endif %}
</section>
</main>
<script>
rome(left, {
dateValidator: rome.val.beforeEq(right),
time: false
});
rome(right, {
dateValidator: rome.val.afterEq(left),
time: false
});
</script>
{% endblock %}