Unifying datetime styles across admin

This commit is contained in:
rockstardev
2019-05-11 17:13:16 -05:00
committed by Nicolas Dorier
parent c705a11aa7
commit 6de5d0bce8
2 changed files with 9 additions and 8 deletions

View File

@@ -67,12 +67,11 @@
</div>
<div class="form-group">
<label asp-for="StartDate" class="control-label"></label>
<div class="input-group ">
<input asp-for="StartDate"
<div class="input-group">
<input type="datetime-local" asp-for="StartDate"
value="@(Model.StartDate?.ToString("u", CultureInfo.InvariantCulture))"
class="form-control flatdtpicker" placeholder="No start date has been set for this crowdfund" />
<div class="input-group-append">
<button class="btn btn-secondary input-group-clear" type="button" title="Clear">
<span class=" fa fa-times"></span>
</button>
@@ -95,13 +94,12 @@
</div>
<div class="form-group">
<label asp-for="EndDate" class="control-label"></label>
<div class="input-group ">
<div class="input-group">
<input type="datetime-local" asp-for="EndDate"
value="@(Model.EndDate?.ToString("u", CultureInfo.InvariantCulture))"
class="form-control flatdtpicker"
placeholder="No end date has been set for this crowdfund" />
<div class="input-group-append">
<button class="btn btn-secondary input-group-clear" type="button" title="Clear">
<span class=" fa fa-times"></span>
</button>

View File

@@ -7,6 +7,7 @@
$(this).text(dateString);
});
// intializing date time pickers throughts website
$(".flatdtpicker").each(function () {
var element = $(this);
var min = element.attr("min");
@@ -14,13 +15,15 @@
var defaultDate = element.attr("value");
element.flatpickr({
enableTime: true,
enableSeconds: true,
dateFormat: 'Z',
altInput: true,
altFormat: 'Y-m-d H:i:S',
minDate: min,
maxDate: max,
defaultDate: defaultDate,
dateFormat: 'Z',
altInput: true,
altFormat: 'J F Y H:i',
time_24hr: true,
defaultHour: 0,
parseDate: function (date) {
return moment(date).toDate();
}