You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
472 B
17 lines
472 B
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
extension DateTimeStringExt on String {
|
|
String formatTimeString({String format = "yyyy.MM.dd HH:mm:ss"}) {
|
|
final DateTime? time = DateTime.tryParse(this);
|
|
if (time == null) return "";
|
|
return DateFormat(format, "en").format(time);
|
|
}
|
|
|
|
int get toInt {
|
|
return int.tryParse(this) ?? 0;
|
|
}
|
|
|
|
Map<String, String> get queryParameters {
|
|
return Uri.tryParse(this)?.queryParameters ?? {};
|
|
}
|
|
}
|