dylanwuzh / flutter-cupertino-date-picker

Flutter cupertino style date picker.
Apache License 2.0
363 stars 416 forks source link

时间格式HH后面只能跟冒号吗?dateFormat not work if not use colon as hour separator #87

Open uniquejava opened 4 years ago

uniquejava commented 4 years ago

Thank you, very Awesome(niubi) plugin! I met the following issue, here is the code: 非常好的组件, 提issue的人也很多,我也是第一次用, 碰到下面的问题, 上代码:

DatePicker.showDatePicker(context,
                  dateFormat: 'yyyy年MM月dd日 HH:mm分',
                  locale: DateTimePickerLocale.zh_cn,
                  pickerMode: DateTimePickerMode.datetime,
                  initialDateTime: DateTime.now());
            }

and Here is the output: 效果如下

image

and then I changed : to , it does not display hour part correctly. 然后我把 : 号改成 就成这样了, 30时30分.

DatePicker.showDatePicker(context,
                  dateFormat: 'yyyy年MM月dd日 HH时mm分',
                  locale: DateTimePickerLocale.zh_cn,
                  pickerMode: DateTimePickerMode.datetime,
                  initialDateTime: DateTime.now());
            }
image

How can I display 2020年03月17日 13时30分 correctly in the datetime picker? 怎么能正常的显示 2020年03月17日 13时30分?

Regards Cyper