forked from vikunja/app
Format
This commit is contained in:
parent
2437270031
commit
d572c2a5e3
|
@ -24,19 +24,19 @@ class VikunjaDateTimePicker extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DateTimePickerFormField(
|
||||
dateOnly: false,
|
||||
editable:
|
||||
false, // Otherwise editing the date is not possible, this setting affects the underlying text field.
|
||||
initialValue: initialValue == DateTime.fromMillisecondsSinceEpoch(0)
|
||||
? null
|
||||
: initialValue,
|
||||
format: vDateFormatLong,
|
||||
decoration: InputDecoration(
|
||||
labelText: label,
|
||||
border: border,
|
||||
icon: icon,
|
||||
),
|
||||
onSaved: onSaved,
|
||||
);
|
||||
dateOnly: false,
|
||||
editable:
|
||||
false, // Otherwise editing the date is not possible, this setting affects the underlying text field.
|
||||
initialValue: initialValue == DateTime.fromMillisecondsSinceEpoch(0)
|
||||
? null
|
||||
: initialValue,
|
||||
format: vDateFormatLong,
|
||||
decoration: InputDecoration(
|
||||
labelText: label,
|
||||
border: border,
|
||||
icon: icon,
|
||||
),
|
||||
onSaved: onSaved,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,8 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
|||
@override
|
||||
Widget build(BuildContext ctx) {
|
||||
_repeatAfterType = getRepeatAfterTypeFromDuration(widget.task.repeatAfter);
|
||||
_repeatAfterValue = getRepeatAfterValueFromDuration(widget.task.repeatAfter);
|
||||
_repeatAfterValue =
|
||||
getRepeatAfterValueFromDuration(widget.task.repeatAfter);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
|
|
@ -2,7 +2,7 @@ getRepeatAfterTypeFromDuration(Duration repeatAfter) {
|
|||
if (repeatAfter == null || repeatAfter.inSeconds == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// if its dividable by 24, its something with days, otherwise hours
|
||||
if (repeatAfter.inHours % 24 == 0) {
|
||||
if (repeatAfter.inDays % 7 == 0) {
|
||||
|
@ -63,4 +63,4 @@ getDurationFromType(String value, String type) {
|
|||
case 'Years':
|
||||
return Duration(days: val * 365);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue