diff --git a/CHANGELOG.md b/CHANGELOG.md index 55ae1ee..b2d7348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ # Changelog +## 1.2.4 + +- **Change**: Added support for `Persian` (fa) locale. +- **Fix**: All known bugs and issues fixed. + ## 1.2.3 +- **Change**: `intl` version updated. - **Change**: Removed unnecessary dependencies. - **Fix**: All known bugs and issues fixed. diff --git a/analysis_options.yaml b/analysis_options.yaml index 4346221..8951019 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -56,7 +56,6 @@ linter: - prefer_conditional_assignment - prefer_const_constructors - prefer_contains - - prefer_equal_for_default_values - prefer_final_fields - prefer_generic_function_type_aliases - prefer_initializing_formals diff --git a/lib/src/_get_time_ago.dart b/lib/src/_get_time_ago.dart index 46871ee..c1bba87 100644 --- a/lib/src/_get_time_ago.dart +++ b/lib/src/_get_time_ago.dart @@ -51,8 +51,8 @@ class GetTimeAgo { static void setDefaultLocale(String locale) { assert( - _messageMap.containsKey(locale), - '[locale] must be a valid locale', + _messageMap.containsKey(locale), + '[locale] must be a valid locale', ); _defaultLocale = locale; } @@ -69,8 +69,10 @@ class GetTimeAgo { /// [Messages] interface with the desired messages /// - static void setCustomLocaleMessages(String customLocale, - Messages customMessages,) { + static void setCustomLocaleMessages( + String customLocale, + Messages customMessages, + ) { _messageMap[customLocale] = customMessages; } @@ -79,7 +81,8 @@ class GetTimeAgo { /// - If [locale] is passed will look for message for that locale. /// - If [pattern] is passed will be used as the DateFormat pattern. - static String parse(DateTime dateTime, { + static String parse( + DateTime dateTime, { String? locale, String? pattern, }) { @@ -89,8 +92,8 @@ class GetTimeAgo { final date = DateFormat(_pattern).format(dateTime); var _currentClock = DateTime.now(); var elapsed = - (_currentClock.millisecondsSinceEpoch - dateTime.millisecondsSinceEpoch) - .abs(); + (_currentClock.millisecondsSinceEpoch - dateTime.millisecondsSinceEpoch) + .abs(); var _prefix = _message.prefixAgo(); var _suffix = _message.suffixAgo(); diff --git a/pubspec.yaml b/pubspec.yaml index 010fae1..36821e2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: get_time_ago description: A Flutter package to convert and format `DateTime` object into `get_time_ago` format to get String like `10 seconds ago`, `a minute ago`, `7 hours ago`, etc. -version: 1.2.3 +version: 1.2.4 homepage: https://github.com/nixrajput repository: https://github.com/nixrajput/get-time-ago issue_tracker: https://github.com/nixrajput/get-time-ago/issues