We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When the database final attribute has null value the DateTimeConverter will throws an error when it's convert a null value.
So I have made a correction with try catch to avoid it. May you could update the example on README.md.
class DateTimeConverter extends TypeConverter<DateTime, int> { @override DateTime decode(int databaseValue) { try { return DateTime.fromMillisecondsSinceEpoch(databaseValue); } catch (e) { return null; } } @override int encode(DateTime value) { try { return value.millisecondsSinceEpoch; } catch (e) { return null; } } }
The text was updated successfully, but these errors were encountered:
The code above was my fix to documentation, it will be nice to update the docs to help the community. As I got no response from team I am closing it.
Sorry, something went wrong.
@cassioseffrin sorry for the late reply. Feel free to open a PR to improve the project's documentation.
@vitusortner I have made the PR, please check it here #442
Thks!
No branches or pull requests
When the database final attribute has null value the DateTimeConverter will throws an error when it's convert a null value.
So I have made a correction with try catch to avoid it. May you could update the example on README.md.
The text was updated successfully, but these errors were encountered: