Created
July 20, 2022 20:16
-
-
Save luebster/1e8a1bbc49157cde608858abaa80906e to your computer and use it in GitHub Desktop.
DataFormatString for passing value to Flatpickr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".datePicker").flatpickr({ | |
enableTime: true, | |
altInput: true, | |
altFormat: "n-j-Y h:i K" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input class="input datePicker" type="text" asp-for="FormModel.PublishDate" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AddArticle | |
{ | |
--- | |
[Display(Name = "Publish Date")] | |
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-M-d HH:mm}")] | |
public DateTime? PublishDate { get; set; } | |
--- | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment