
- MomentJS 教程
- MomentJS - 主頁
- MomentJS - 概覽
- MomentJS - 環境設定
- MomentJS - 介紹
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - 獲取器/設定器
- 操作日期和時間
- 格式化日期和時間
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - 時段
- MomentJS - 實用工具
- MomentJS - 外掛
- MomentJS - 例項
- MomentJS 有用資源
- MomentJS - 快速指南
- MomentJS - 有用資源
- MomentJS - 討論
MomentJS - 是否為時段
此方法用於檢查變數是否為 moment 時段物件。
語法
moment.isDuration(obj);
示例
var d = moment.isDuration(moment.duration(2, 'weeks')); var st = moment.isDuration(moment()); var s = moment.isDuration(new Date());
輸出

momentjs_durations.htm
廣告