Merge pull request #1080 from richardshiue/fix-include-time

fix: some improvements for when including time in a date cell
This commit is contained in:
Annie
2022-09-21 20:08:35 +08:00
committed by GitHub
11 changed files with 24 additions and 21 deletions

View File

@ -108,7 +108,7 @@ class DateCalBloc extends Bloc<DateCalEvent, DateCalState> {
(err) {
switch (ErrorCode.valueOf(err.code)!) {
case ErrorCode.InvalidDateTimeFormat:
updateCalData(none(), Some(timeFormatPrompt(err)));
updateCalData(state.calData, Some(timeFormatPrompt(err)));
break;
default:
Log.error(err);
@ -119,13 +119,13 @@ class DateCalBloc extends Bloc<DateCalEvent, DateCalState> {
}
String timeFormatPrompt(FlowyError error) {
String msg = "${LocaleKeys.grid_field_invalidTimeFormat.tr()}. ";
String msg = "${LocaleKeys.grid_field_invalidTimeFormat.tr()}.";
switch (state.dateTypeOptionPB.timeFormat) {
case TimeFormat.TwelveHour:
msg = "${msg}e.g. 01: 00 AM";
msg = "$msg e.g. 01:00 PM";
break;
case TimeFormat.TwentyFourHour:
msg = "${msg}e.g. 13: 00";
msg = "$msg e.g. 13:00";
break;
default:
break;

View File

@ -261,6 +261,7 @@ class _TimeTextFieldState extends State<_TimeTextField> {
child: RoundedInputField(
height: 40,
focusNode: _focusNode,
autoFocus: true,
hintText: state.timeHintText,
controller: _controller,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),