Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suppor for Date object as default for date field #52

Open
str opened this issue Jan 28, 2019 · 4 comments
Open

Add suppor for Date object as default for date field #52

str opened this issue Jan 28, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@str
Copy link

str commented Jan 28, 2019

I'm trying to set the DateTime object as param as default for the Form::date() helper, without success.

$date = new \DateTime('tomorrow');
{!! Form::date('date', 'Matches for date:', $date) !!}

Should we add suport for that?

Current workardound is $date->format('Y-m-d'), but should not.

@netojose
Copy link
Owner

Hi @str , is a good idea. But the package doesn't know the desired format to be applied to "stringify it". Do you have some suggestion?

@str
Copy link
Author

str commented Jan 28, 2019

The required format for the input[type=date] is 'Y-m-d'. The format to be shown to the user is selected by the browser depending on the user's locale.

@netojose
Copy link
Owner

Cool, thanks! I will implement this. I'm working in a new version (just refactoring the FormBuilder class) and I will add this (maybe available in 5 days.)

@netojose netojose self-assigned this Jan 28, 2019
@netojose netojose added the enhancement New feature or request label Jan 28, 2019
@str
Copy link
Author

str commented Jan 28, 2019

BTW, great project. I don't understand why aren't there any projects like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants