- MomentJS 教程
- MomentJS - 首頁
- MomentJS - 概述
- MomentJS - 環境設定
- MomentJS - 介紹
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - 獲取器/設定器
- 操作日期和時間
- 格式化日期和時間
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 定製
- MomentJS - 持續時間
- MomentJS - 實用工具
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 有用資源
- MomentJS - 快速指南
- MomentJS - 有用資源
- MomentJS - 討論
MomentJS - 新增時間
此方法將時間新增到當前持續時間。
語法
moment.duration().add(Number, String); moment.duration().add(Number); moment.duration().add(Duration); moment.duration().add(Object);
示例
var m = moment.duration().add(45, 'd'); var output = JSON.stringify(m._data);
輸出
示例
var m = moment.duration().add({ days: 7, months: 1 });
輸出
momentjs_durations.htm
廣告