原帖:
https://github.com/mmazzarolo/react-native-modal-datetime-picker
DatePickerIOS选择24小时的方法:
How to set 24 hours in iOS ?
The is24Hour
prop is only available on Android but you use a small hack for enabling it on iOS by setting the app's default timezone as en_GB
. To do so, edit your AppDelegate.m
file, and add [[UIDatePicker appearance] setLocale:[[NSLocale alloc]initWithLocaleIdentifier:@"en_GB"]];
to application didFinishLaunchingWithOptions
本人使用了第三方:react-native-modal-datetime-picker
因为该组件引入momentjs,同时还需要修改属性format为:format="MM-DD, HH:mm" ,即可成功显示24小时制
详情:http://momentjs.com/docs/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)