Skip to content

Commit

Permalink
Remove dependency on package:intl
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Sep 23, 2024
1 parent 23567be commit 247ddae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions pkgs/unified_analytics/lib/src/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:file/file.dart';
import 'package:file/local.dart';
import 'package:file/memory.dart';
import 'package:http/http.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;

Expand Down Expand Up @@ -436,10 +435,6 @@ class AnalyticsImpl implements Analytics {
kLogFileName,
)),
) {
// Initialize date formatting for `package:intl` within constructor
// so clients using this package won't need to
initializeDateFormatting();

// This initializer class will let the instance know
// if it was the first run; if it is, nothing will be sent
// on the first run
Expand Down
4 changes: 2 additions & 2 deletions pkgs/unified_analytics/lib/src/config_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import 'dart:convert';

import 'package:clock/clock.dart';
import 'package:convert/convert.dart';
import 'package:file/file.dart';
import 'package:intl/intl.dart';
import 'package:path/path.dart' as p;

import 'constants.dart';
Expand Down Expand Up @@ -226,7 +226,7 @@ class ToolInfo {
@override
String toString() {
return json.encode(<String, Object?>{
'lastRun': DateFormat('yyyy-MM-dd').format(lastRun),
'lastRun': FixedDateTimeFormatter('YYYY-MM-DD').encode(lastRun),
'versionNumber': versionNumber,
});
}
Expand Down
4 changes: 2 additions & 2 deletions pkgs/unified_analytics/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'dart:io' as io;
import 'dart:math' show Random;

import 'package:clock/clock.dart';
import 'package:convert/convert.dart';
import 'package:file/file.dart';
import 'package:intl/intl.dart';
import 'package:path/path.dart' as p;

import 'enums.dart';
Expand All @@ -21,7 +21,7 @@ import 'user_property.dart';
/// yyyy-MM-dd (2023-01-09)
/// ```
String get dateStamp {
return DateFormat('yyyy-MM-dd').format(clock.now());
return FixedDateTimeFormatter('YYYY-MM-DD').encode(clock.now());
}

/// Reads in a directory and returns `true` if write permissions are enabled.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ environment:

dependencies:
clock: ^1.1.1
convert: ^3.1.1
file: '>=6.1.4 <8.0.0'
http: '>=0.13.5 <2.0.0'
intl: '>=0.18.0 <0.20.0'
meta: ^1.9.0
path: ^1.8.0

Expand Down

0 comments on commit 247ddae

Please # to comment.