From 6376d87fe781f39baad82f1b552915416e206be5 Mon Sep 17 00:00:00 2001 From: Stefano Borghi Date: Thu, 1 Oct 2020 00:23:26 -0700 Subject: [PATCH] Updated Duration documentation Ref https://github.com/iamkun/dayjs/pull/1099 --- docs/plugin/duration.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/plugin/duration.md b/docs/plugin/duration.md index 9d7992a91..028626051 100644 --- a/docs/plugin/duration.md +++ b/docs/plugin/duration.md @@ -10,3 +10,10 @@ dayjs.extend(duration) dayjs.duration(100) ``` + +In addition, you can now add `Duration` values to `dayjs` instances: +```javascript +const d = dayjs('2020-10-01'); +const days = dayjs.duration(2, 'days'); +d.add(days).format('YYYY-MM-DD')); // 2020-10-03 +```