简体   繁体   English

Laravel Voyager v1.1 日期格式不起作用

[英]Laravel Voyager v1.1 date format not working

I tried to make the date field with different format on Laravel Voyager 1.1 as shown below:我尝试在 Laravel Voyager 1.1 上制作不同格式的日期字段,如下所示:

面包日期字段格式

and yet the upon creation of the record its still using the default format:然而在创建记录时它仍然使用默认格式:

日期格式仍然不受影响

the correct syntax is正确的语法是

{ "format" : "%d-%m-%Y" } {“格式”:“%d-%m-%Y”}

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.当您更改/vendor/tcg/voyager/resources/views/bread/read.blade.php ,它只会在视图刀片 ( /vendor/tcg/voyager/resources/views/bread/read.blade.php ) 中更改,而不是在edit/add视图中。

If you want to change it in add/edit view as well, you need to overwrite the default blade of voyager.如果您还想在add/edit视图中更改它,则需要覆盖 voyager 的默认刀片。 You need to overwrite/alter following blade file as per your requirement:您需要根据您的要求覆盖/更改以下刀片文件:

/vendor/tcg/voyager/resources/views/formfields/date.blade.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM