0

I tried to make the date field with different format on Laravel Voyager 1.1 as shown below:

bread date field format

and yet the upon creation of the record its still using the default format:

date format still not affected

halfer
  • 19,824
  • 17
  • 99
  • 186
Hendry
  • 25
  • 1
  • 6

3 Answers3

3

the correct syntax is

{ "format" : "%d-%m-%Y" }

0

When you change the formate, it will only change in view blade (/vendor/tcg/voyager/resources/views/bread/read.blade.php) not in edit/add view.

If you want to change it in add/edit view as well, you need to overwrite the default blade of voyager. You need to overwrite/alter following blade file as per your requirement:

/vendor/tcg/voyager/resources/views/formfields/date.blade.php
halfer
  • 19,824
  • 17
  • 99
  • 186
AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57
0

Still facing this issue in 2023, this is how I solved:
1- On my rewrite template resources/views/vendor/voyager/formfields/timestamp.blade.php I've changed the class of the input to:

     class="form-control custom-datepicker"


2- Added custom js as explained here: https://voyager-docs.devdojo.com/customization/additional-css-js with:

$(document).ready(function () {
    $('.custom-datepicker').datetimepicker({
    format: 'DD/MM/YYYY hh:mm'
    });
})

Ana
  • 1
  • 1