mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
21 lines
431 B
Dart
21 lines
431 B
Dart
import 'package:intl/intl.dart';
|
|
|
|
num toNum(String e) {
|
|
return num.parse(e);
|
|
}
|
|
|
|
String toString(num e) {
|
|
return e.toString();
|
|
}
|
|
|
|
/*
|
|
* Converts a datetime to ISO8601 date format, but only the date.
|
|
* Needed e.g. when the wger api only expects a date and no time information.
|
|
*/
|
|
String toDate(DateTime dateTime) {
|
|
if (dateTime == null) {
|
|
return null;
|
|
}
|
|
return DateFormat('yyyy-MM-dd').format(dateTime).toString();
|
|
}
|