forked from eatvio/eatvio_app
19 lines
633 B
Dart
19 lines
633 B
Dart
import 'package:eatvio_app/core/utils/date_time_utils.dart';
|
||
|
||
enum PeriodFilterStatus {
|
||
all,
|
||
month,
|
||
week;
|
||
|
||
String get name => switch (this) {
|
||
PeriodFilterStatus.all => 'Все периоды',
|
||
PeriodFilterStatus.month => 'За месяц',
|
||
PeriodFilterStatus.week => 'За неделю',
|
||
};
|
||
|
||
String? get value => switch (this) {
|
||
PeriodFilterStatus.all => null,
|
||
PeriodFilterStatus.month => DateTime.now().subtract(const Duration(days: 30)).format('yyyy-MM-dd'),
|
||
PeriodFilterStatus.week => DateTime.now().subtract(const Duration(days: 7)).format('yyyy-MM-dd'),
|
||
};
|
||
} |