Change a date format

Last Updated: 22.02.2019

You can change the date format in your landing page form. Depending o the date format used in different countries, you can customize form field to create your own Date field,  supporting i.e the format: MM/DD/YEAR

1. Go to the editor of your landing page and then click on Edit a form.

edit_form1

2. Find your current Date field and delete it.

date_field

3. Then add a new simple input field with attribute name date.

date_field_settings

4. Find Settings in the right top corner of the editor and add custom CSS style below:

@import url("/js/libs/bootstrap-datepicker/dist/css/bootstrap-datepicker.standalone.min.css")
add_css1

5. Publish your landing page and click on Go to campaign.

publish1
gotocampaign

6. Choose JavaScript code tab on the landing page dashboard and add a new script.

javascriptcode

7. Copy the script below and add it as a new script to the main page on body bottom position.

<script type="text/javascript" src="/js/libs/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<script type="text/javascript" src="/js/libs/bootstrap-datepicker/dist/locales/bootstrap-datepicker.en.min.js"></script>

<script type="text/javascript">
  (function ($) {
     $('[name="date"]').datepicker({
       autoclose: true,
       clearBtn: true,
       format: 'mm/dd/yyyy',
       language: 'en',
       todayBtn: 'linked',
       todayHighlight: true
     });
  })(jQuery);
</script>
date_field_code

8. Check your landing page online – the date format should display in the new order.

date_form
Was this article helpful?

Can’t find what you need?

Let us help you!
Send us a message
We are using cookies for analytical purpose. Learn more.