@ledvance/base 1.2.39 → 1.2.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/common.ts +2 -3
package/package.json
CHANGED
package/src/utils/common.ts
CHANGED
|
@@ -321,13 +321,12 @@ export function convertMinutesTo12HourFormat(minutes: number, is24: boolean) {
|
|
|
321
321
|
if(is24){
|
|
322
322
|
return `${toFixedString(hours, 2)}:${toFixedString(mins, 2)}`
|
|
323
323
|
}
|
|
324
|
+
// 构造12小时制时间字符串
|
|
325
|
+
const suffix = (hours >= 12) ? I18n.getLang('manage_user_calendar_label_pm') : I18n.getLang('manage_user_calendar_label_am');
|
|
324
326
|
// 检查小时数是否大于12,并调整
|
|
325
327
|
if (hours > 12) {
|
|
326
328
|
hours -= 12;
|
|
327
329
|
}
|
|
328
|
-
|
|
329
|
-
// 构造12小时制时间字符串
|
|
330
|
-
const suffix = (hours >= 12) ? I18n.getLang('manage_user_calendar_label_pm') : I18n.getLang('manage_user_calendar_label_am');
|
|
331
330
|
hours = (hours == 0) ? 12 : hours; // 处理午夜0点为12小时制的12点
|
|
332
331
|
const time12Hour = suffix + ' ' + hours + ':' + (mins < 10 ? '0' : '') + mins;
|
|
333
332
|
|