-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Nov 18 build fixes #554
Nov 18 build fixes #554
Conversation
if (this < 60) { | ||
return toString() + (longForm ? ' seconds' : 's'); // TODO: add i18n | ||
return longForm | ||
? 'longform_seconds'.i18n.fill([toString()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of localization!
/// Based on https://www.flutterclutter.dev/flutter/tutorials/date-format-dynamic-string-depending-on-how-long-ago/2020/229/ | ||
extension Humanize on int { | ||
String humanizeSeconds({bool longForm = false}) { | ||
//seconds | ||
var result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is one of the few that actually has a working unit test. Can you please update the unit test to match your changes?
Oh, and of course the unit test still needs to be updated, but then this can be merged. |
Test passes, LGTM! |
humanizeSeconds()