Skip to content
New issue

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

JS:获取月份最后一天 #81

Open
smileyby opened this issue May 25, 2021 · 0 comments
Open

JS:获取月份最后一天 #81

smileyby opened this issue May 25, 2021 · 0 comments
Labels

Comments

@smileyby
Copy link
Owner

// 此处需要注意的是 month对应的是月份的 index
// 先获取下个月的第一天时间戳,减一天就是当前月最后一天的时间戳
let nextMonthFirstDay = new Date(year, month, 1);
let currentMonthLastDay = new Date(nextMonthFirstDay.getTime()-10006060*24).getDate();

@smileyby smileyby added the JavaScript ☀️ JavaScript label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant