Project

General

Profile

解析Bug #352

Leap years are not supported in date plugin for order list

Added by Zhongbao Ye almost 2 years ago. Updated about 1 year ago.

Status:
已关闭
Priority:
普通
Assignee:
Target version:
IT: Easytryck (Sweden) - v3.0
Start date:
02/29/2024
Due date:
02/29/2024
% Done:

100%

Estimated time:
2.00 h
Spent time:

Description

Task Details
  1. 订单列表中的日期插件默认值不支持闰年2月29日的显示
Input
  • Lake
Output
  • Report and Solution

Others

#1

Updated by Zhongbao Ye almost 2 years ago

  • % Done changed from 0 to 100
Output(2024/02/29) 居家
  • Reason: Hard coding is used when calculating the last day of each month. The last day of February is always the 28th.
  • Solution: 2024/02/29 15:00
    Modify the algorithm in date to support leap year display
    Old: last_day = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][(new Date).getMonth()]
    New: last_day = (0 (new Date).getFullYear() % 4 && 0 != (new Date).getFullYear() % 100 || 0 (new Date).getFullYear() % 400) && 1 == (new Date).getMonth() ? "29" : [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][(new Date).getMonth()]

    protected/views/layouts/desktop.php
    ui/desktop/js/order.js

#2

Updated by Zhongbao Ye almost 2 years ago

  • Status changed from 进行中 to 已关闭
#3

Updated by Xihua Fan about 1 year ago

  • Target version set to v3.0

Also available in: Atom PDF