From 014234cff73c24d67d634694ea363855696b046b Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Tue, 12 Jun 2018 14:38:36 +0800 Subject: [PATCH] no message Former-commit-id: a21f8679ae68ee309018e5ee3b0f7b3a00782d5d Former-commit-id: 4fa8e25e8e7048b64b0b3ce4c3fd6f2dc60f83bf Former-commit-id: da990408bf8c93f57f48d10d4d1088dd750ad651 Former-commit-id: 2d2c8420f8c2c89d37c0bf016c6680abc45ab2a7 --- src/pages/demo/plugins/day/index.vue | 51 ++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/src/pages/demo/plugins/day/index.vue b/src/pages/demo/plugins/day/index.vue index 5b07e09c..cafe332a 100644 --- a/src/pages/demo/plugins/day/index.vue +++ b/src/pages/demo/plugins/day/index.vue @@ -9,27 +9,48 @@

获取

- {{now.year()}} - {{now.month()}} - {{now.date()}} - {{now.day()}} - {{now.hour()}} - {{now.minute()}} - {{now.second()}} - {{now.millisecond()}} + {{now.year()}} + {{now.month()}} + {{now.date()}} + {{now.day()}} + {{now.hour()}} + {{now.minute()}} + {{now.second()}} + {{now.millisecond()}}

设置

- {{now.set('month', 6).month()}} - {{now.set('second', 30).second()}} - {{now.set('hour', 4).hour()}} + {{now.set('month', 6).month()}} + {{now.set('second', 30).second()}} + {{now.set('hour', 4).hour()}}

操作

- {{now.add(1, 'day').format('YYYY年M月D日 HH:mm:ss')}} - {{now.subtract(7, 'year').format('YYYY年M月D日 HH:mm:ss')}} - {{now.startOf('year').format('YYYY年M月D日 HH:mm:ss')}} - {{now.endOf('month').format('YYYY年M月D日 HH:mm:ss')}} + {{now.add(1, 'day').format('YYYY年M月D日 HH:mm:ss')}} + {{now.subtract(7, 'year').format('YYYY年M月D日 HH:mm:ss')}} + {{now.startOf('year').format('YYYY年M月D日 HH:mm:ss')}} + {{now.endOf('month').format('YYYY年M月D日 HH:mm:ss')}} + +

显示

+ + {{now.format('YYYY-M-D HH:mm:ss')}} + {{now.diff(now.subtract(1, 'day'), 'days')}} + {{now.valueOf()}} + {{now.unix()}} + {{now.daysInMonth()}} + {{now.toDate()}} + {{now.toArray()}} + {{now.toJSON()}} + {{now.toISOString()}} + {{now.toString()}} + {{now.toObject()}} + +

查询

+ + {{now.isBefore(now.add(1, 'day'), 'days')}} + {{now.isBefore(now.subtract(1, 'day'), 'days')}} + {{now.isSame(now)}} + {{now.isSame(now.add(1, 'day'), 'days')}}