diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_time_text_field.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_time_text_field.dart index acd50ce764..553ffb4c0d 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_time_text_field.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_time_text_field.dart @@ -301,6 +301,14 @@ class _DateTimeTextFieldState extends State { focusNode: timeFocusNode, controller: timeTextController, style: Theme.of(context).textTheme.bodyMedium, + maxLength: widget.timeFormat == TimeFormatPB.TwelveHour + ? 8 // 12:34 PM = 8 characters + : 5, // 12:34 = 5 characters + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[0-9:AaPpMm]'), + ), + ], decoration: getInputDecoration( const EdgeInsetsDirectional.fromSTEB(6, 6, 12, 6), timeFormat.format(hintDate), @@ -359,6 +367,7 @@ class _DateTimeTextFieldState extends State { isCollapsed: true, isDense: true, hintText: widget.showHint ? hintText : null, + counterText: "", hintStyle: Theme.of(context) .textTheme .bodyMedium