Skip to content

Commit

Permalink
Fix date format in example
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikvdkaaden committed May 24, 2024
1 parent 0a3c42c commit 389f281
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
8 changes: 6 additions & 2 deletions example/lib/timestamp.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:floor/floor.dart';
import 'package:intl/intl.dart';

@Embed()
class Timestamp {
Expand All @@ -23,6 +24,9 @@ class Timestamp {

@override
String toString() {
return 'Timestamp{createdAt: $createdAt, updatedAt: $updatedAt}';
final DateFormat formatter = DateFormat('yyyy-MM-dd');
final String formattedCreatedAt = formatter.format(createdAt);
final String formattedUpdatedAt = formatter.format(updatedAt);
return 'Timestamp{createdAt: $formattedCreatedAt, updatedAt: $formattedUpdatedAt}';
}
}
}
8 changes: 8 additions & 0 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.2"
intl:
dependency: "direct main"
description:
name: intl
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
url: "https://pub.dev"
source: hosted
version: "0.17.0"
io:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
flutter:
sdk: flutter
sqflite: any # This dependency is needed to solve the problem with warning about transitive dependencies
intl: ^0.17.0

dev_dependencies:
analyzer: ^6.4.1
Expand Down
2 changes: 1 addition & 1 deletion floor_generator/lib/processor/database_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import 'package:floor_generator/processor/embed_processor.dart';
import 'package:floor_generator/processor/entity_processor.dart';
import 'package:floor_generator/processor/error/database_processor_error.dart';
import 'package:floor_generator/processor/processor.dart';
import 'package:floor_generator/value_object/embed.dart';
import 'package:floor_generator/processor/view_processor.dart';
import 'package:floor_generator/value_object/dao_getter.dart';
import 'package:floor_generator/value_object/database.dart';
import 'package:floor_generator/value_object/embed.dart';
import 'package:floor_generator/value_object/entity.dart';
import 'package:floor_generator/value_object/queryable.dart';
import 'package:floor_generator/value_object/type_converter.dart';
Expand Down

0 comments on commit 389f281

Please sign in to comment.