|
@@ -45,11 +45,16 @@ export default {
|
|
|
if (this.showWeek) infos.push(weekDay);
|
|
|
|
|
|
const hourNum = now.getHours();
|
|
|
- const val = hourNum > 12 ? hourNum - 12 : hourNum;
|
|
|
- const hour = ("00" + val).substr(("" + val).length);
|
|
|
- const apm = hourNum < 12 ? "上午" : "下午";
|
|
|
- if (this.showApm) infos.push(apm);
|
|
|
- infos.push(`${hour}:${timeStr[1]}`);
|
|
|
+ if (this.showApm) {
|
|
|
+ const val = hourNum > 12 ? hourNum - 12 : hourNum;
|
|
|
+ const hour = ("00" + val).substr(("" + val).length);
|
|
|
+ const apm = hourNum < 12 ? "上午" : "下午";
|
|
|
+ infos.push(apm);
|
|
|
+ infos.push(`${hour}:${timeStr[1]}`);
|
|
|
+ } else {
|
|
|
+ const hour = ("00" + hourNum).substr(("" + hourNum).length);
|
|
|
+ infos.push(`${hour}:${timeStr[1]}`);
|
|
|
+ }
|
|
|
|
|
|
this.text = infos.join(" ");
|
|
|
},
|