Compare commits

..

2 Commits

Author SHA1 Message Date
白书科技
f1985d0b8f
!6 优化
Merge pull request !6 from 白书科技/fix/1007
2023-10-07 09:55:43 +00:00
unknown
3eafab1d41 首页学习时间不显示天数 2023-10-07 17:53:57 +08:00
2 changed files with 4 additions and 25 deletions

View File

@ -298,27 +298,17 @@ const IndexPage = () => {
{studyTimeFormat(stats.today_learn_duration)[0] ||
0}{" "}
</strong>
</>
)}
{studyTimeFormat(stats.today_learn_duration)[1] !== 0 && (
<>
<strong>
{" "}
{studyTimeFormat(stats.today_learn_duration)[1] ||
0}{" "}
</strong>
</>
)}
<strong>
{" "}
{studyTimeFormat(stats.today_learn_duration)[2] || 0}{" "}
{studyTimeFormat(stats.today_learn_duration)[1] || 0}{" "}
</strong>
<strong>
{" "}
{studyTimeFormat(stats.today_learn_duration)[3] || 0}{" "}
{studyTimeFormat(stats.today_learn_duration)[2] || 0}{" "}
</strong>
</div>
@ -331,27 +321,17 @@ const IndexPage = () => {
{studyTimeFormat(stats.learn_duration || 0)[0] ||
0}{" "}
</strong>
</>
)}
{studyTimeFormat(stats.learn_duration || 0)[1] !== 0 && (
<>
<strong>
{" "}
{studyTimeFormat(stats.learn_duration || 0)[1] ||
0}{" "}
</strong>
</>
)}
<strong>
{" "}
{studyTimeFormat(stats.learn_duration || 0)[2] || 0}{" "}
{studyTimeFormat(stats.learn_duration || 0)[1] || 0}{" "}
</strong>
<strong>
{" "}
{studyTimeFormat(stats.learn_duration || 0)[3] || 0}{" "}
{studyTimeFormat(stats.learn_duration || 0)[2] || 0}{" "}
</strong>
</div>

View File

@ -28,7 +28,6 @@ export function durationFormat(dateStr: number) {
export function studyTimeFormat(dateStr: number) {
var d = moment.duration(dateStr / 1000, "seconds");
let value = [];
value.push(Math.floor(d.asDays()));
value.push(d.hours());
value.push(d.minutes());
value.push(d.seconds());