1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| /**
| * 获取年月日
| */
| export function getYearAndMonthAndDays(date=new Date()) {
| let year = date.getFullYear()
| let month = date.getMonth() + 1
| if (month < 10) {
| month = '0' + month + '-'
| } else {
| month = month + '-'
| }
| year = year + '-'
| let days = date.getDate()
| if (days < 10) {
| days = '0' + days
| } else {
| days = days
| }
| return (year + month + days)
| }
|
|