Closed mrstu84 closed 3 months ago
format
is used to define the date for Carbon to read from Javascript (Used mostly in query or default values) , it should match the displayFormat in (PHP format style).
In your case just use displayFormat.
Thank you for coming back to me.
I would like the value to display as 01-01-1970 - 01-01-2024
in the input field and then be submitted to PHP as 1970-01-01 - 2024-01-01
, as mentioned in my original comment. I don't think you suggestion facilitates this.
Do you mean you want to save the value in a different format to database?
On Wed, May 1, 2024, 10:23 AM Stewart Doxey @.***> wrote:
Thank you for coming back to me.
I would like the value to display as 01-01-1970 - 01-01-2024 in the input field and then be submitted to PHP as 1970-01-01 - 2024-01-01, as mentioned in my original comment. I don't think you suggestion facilitates this.
— Reply to this email directly, view it on GitHub https://github.com/malzariey/filament-daterangepicker-filter/issues/71#issuecomment-2088086318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPCALJ52IJ5YNYYOJGSSSDZACJ7JAVCNFSM6AAAAABGYPDUL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGA4DMMZRHA . You are receiving this because you modified the open/close state.Message ID: @.*** .com>
Yes, that's correct. Maybe I am misunderstanding the documentation but I have read it that you can display one format in the input field and then submit that to the codebase and database in a different format. Hence the displayFormat and format attributes.
Sorry at the moment, the feature is not available .
On Wed, May 1, 2024, 10:30 AM Stewart Doxey @.***> wrote:
Yes, that's correct. Maybe I am misunderstanding the documentation but I have read it that you can display one format in the input field and then submit that to the codebase and database in a different format. Hence the displayFormat and format attributes.
— Reply to this email directly, view it on GitHub https://github.com/malzariey/filament-daterangepicker-filter/issues/71#issuecomment-2088092411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPCALJ7E2CAZ5SMCNVVCU3ZACK3DAVCNFSM6AAAAABGYPDUL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGA4TENBRGE . You are receiving this because you modified the open/close state.Message ID: @.*** .com>
My misunderstanding. Thank you for coming back to me!
I am using the date picker as a field (and not a filter) with displayFormat set to
DD-MM-YYY
and format set toY-m-d
. Each time the date range is return in the same format as the displayFormat, rather than format.For example:
When filtering between 01-01-1970 and 01-01-2024, here's my form schema -
And the value is returned as
01-01-1970 - 01-01-2024
, rather than the expected value of1970-01-01 - 2024-01-01
.