We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[问题简述] util.js文件的prevDay函数返回日期不正确,year, month , day为数字类型,相加结果为数字,非接口需要的时间格式;导致接口请求错误,其源码如下:
// 源码 // ... // 获取上一天日期 Util.prevDay = function (timestamp = (new Date()).getTime()) { const date = new Date(timestamp); const year = date.getFullYear(); const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); return year + month + day; };
修改如下:
// 修改 // ... // 获取上一天日期 Util.prevDay = function (timestamp = (new Date()).getTime()) { const date = new Date(timestamp); const year = date.getFullYear(); const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); return year + '' + month + '' + day; };
The text was updated successfully, but these errors were encountered:
没起作用
Sorry, something went wrong.
#17
No branches or pull requests
[问题简述]
util.js文件的prevDay函数返回日期不正确,year, month , day为数字类型,相加结果为数字,非接口需要的时间格式;导致接口请求错误,其源码如下:
修改如下:
The text was updated successfully, but these errors were encountered: