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 Feature DateTimePicker with String for initialValue #208

Closed
ekasetiawans opened this issue Dec 18, 2019 · 4 comments
Closed

Add Feature DateTimePicker with String for initialValue #208

ekasetiawans opened this issue Dec 18, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@ekasetiawans
Copy link

Add feature to convert String into DateTime.
Currently, valueTransformer only convert DateTime into String and executed onSave. But I want same way to convert String into DateTime as initialValue.

for example:

Map<String, dynamic> data = {
   "birthday" : "1990-12-23 08:00:00",
};

...
FormBuilder(
  initialValue: data,
  child: Column(
    children : [
        FormBuilderDateTimePicker(
             attribute: "birthday", // will throws error, because birthday value is not a subtype of DateTime
        ),
    ],
  ),
),
...
@isojtouano
Copy link

You can use DateTime.parse(String here)

@danvick
Copy link
Collaborator

danvick commented Mar 27, 2020

Hi @ekasetiawans,
I'll consider this in later versions of the package, in the meantime, kindly consider using @isojtouano's suggestion.

@ekasetiawans
Copy link
Author

Hi @ekasetiawans,
I'll consider this in later versions of the package, in the meantime, kindly consider using @isojtouano's suggestion.

Hi @danvick thankyou very much

@danvick danvick added the enhancement New feature or request label May 7, 2020
@danvick
Copy link
Collaborator

danvick commented Dec 21, 2020

Because of Dart's type-safety feature, it would be much of a hassle to make this happen. We'll therefore stick to the suggested solution.

@danvick danvick closed this as completed Dec 21, 2020
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

3 participants