Added custom date (reason: firefox never love date inputs)
This commit is contained in:
@@ -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 %}
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
<br>
|
||||
|
||||
<label for="expired_at">Berlaku dari: </label>
|
||||
<input type="date" name="valid_at" value="{{ timestamp }}">
|
||||
<input id="left" name="valid_at" value="{{ timestamp }}">
|
||||
|
||||
<br>
|
||||
|
||||
<label for="expired_at">Berlaku sampai: </label>
|
||||
<input type="date" name="expired_at" value="{{ timestamp }}">
|
||||
<input id="right" name="expired_at" value="{{ timestamp }}">
|
||||
|
||||
<br>
|
||||
</div>
|
||||
@@ -55,4 +55,15 @@
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
rome(left, {
|
||||
dateValidator: rome.val.beforeEq(right),
|
||||
time: false
|
||||
});
|
||||
rome(right, {
|
||||
dateValidator: rome.val.afterEq(left),
|
||||
time: false
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<script src="https://use.fontawesome.com/0aa8f3d106.js"></script>
|
||||
<link rel="stylesheet" href="/css/picnic.min.css">
|
||||
<link rel="stylesheet" href="/css/rome.css">
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
|
||||
<style>
|
||||
@@ -46,6 +47,10 @@
|
||||
.fr {
|
||||
float: right;
|
||||
}
|
||||
|
||||
td, th {
|
||||
padding: .3em .45em .3em .6em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -55,9 +60,9 @@
|
||||
</a>
|
||||
{% block nav %}{% endblock %}
|
||||
</nav>
|
||||
<script src="/js/rome.js"></script>
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="/js/rome.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user