In forms for editors (in Swift) I use the HTML5 date field.
I need to be able to select a date back in time.
How is this possible?
Thanks!
In forms for editors (in Swift) I use the HTML5 date field.
I need to be able to select a date back in time.
How is this possible?
Thanks!
Hi Michael
You probably use a standard html 5 control then - and it should support dates back in time - see i.e. here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
You might have a template or something that prevents you from selecting back in time - depending on your implementation. But then we need to see your form in order to tell what is preventing dates back in time. Feel free to post URL here or contact care.
BR Nicolai
the reason why, you only could select future dates is the in the template /Files/Templates/Designs/Swift/Forms/Form/Default.cshtml
there is a bit of script where the mindate is set for "tomorrow"
I belive that the template is a standard, not edited template that comes with swift.
comment the property out, and you can select any date you want
BR Kenneth
<script type="module"> swift.AssetLoader.Load('/Files/Templates/Designs/Swift/Assets/css/flatpickr.min.css', 'css'); @* Wait for flatpickr styles and then import the js and load the flatpick instance *@ document.addEventListener('load.swift.assetloader', function () { import('/Files/Templates/Designs/Swift/Assets/js/flatpickr.js').then(function(){ @* Set the flatpickr locale language from culture info *@ flatpickr.localize(flatpickr.l10ns.@(Pageview.Area.CultureInfo.TwoLetterISOLanguageName)); flatpickr(".flatpickr", { altInput: true, weekNumbers: true, //minDate: new Date().fp_incr(1), wrap: true, formatDate: (date, format, locale) => { return date.toLocaleDateString('@(Pageview.Area.CultureInfo)'); }, }); }); }) </script>
Good find.
We will change it.
You must be logged in to post in the forum