Closed ghost closed 8 years ago
Hi! Maybe you can tell us a bit more: when do you want to format it? When the user comes to the page there ought to be already a default value in the correct format? Or has it to be formatted, when the field is submitted to the database? Or something else? :) Maybe this helps you: https://laravelcollective.com/docs/5.3/html#date or this: http://andrewhuggins.com/blog/working-with-datetime-field-in-laravel
Anyway, I'm trying to make a version of the crud generator package with removed dependencies for bootstrap and laravel collective modules. Maybe it's easier then for you to format custom values.
Hello, Thanks for your package.
For example in table I have modified date like: 2015-10-10 Now I want to change this to Jalali on display and convert to 2015-10-10 on save.
I think for this you need a package like this: https://github.com/sallar/jDateTime - but this is unmaintained. There's a link to this one: http://farhadi.ir/blog/1389/02/10/persian-calendar-for-php-53/ I don't understand that page, but probably you do :)
I think then you have to do something like:
{!! Form::input('datetime-local', 'expire', $your_item_name_here->expire->format('Y-m-d\TH:i')) !!}
... with the desired format and according to the instructions on http://farhadi.ir/blog/1389/02/10/persian-calendar-for-php-53/
(untested)
The conversion back to 2015-10-10 format before writing to the database should be done in the Controller I think.
Check issue #137
Hello, I want to format datetime but I don't know how to do it.
:message
') !!}now I want to add a function to format datetime for my application.