- MomentJS 教程
- MomentJS - 首頁
- MomentJS - 概述
- MomentJS - 環境設定
- MomentJS - 簡介
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - 獲取器/設定器方法
- 處理日期和時間
- 格式化日期和時間
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - 持續時間
- MomentJS - 實用程式
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 實用資源
- MomentJS - 快速指南
- MomentJS - 實用資源
- MomentJS - 討論
MomentJS - 週數
此方法將從持續時間中返回週數詳細資訊。要獲取持續時間的周長度,請使用 **moment.duration().asWeeks()** 方法。
語法
moment.duration().weeks(); moment.duration().asWeeks();
示例
var m = moment.duration(500, "weeks").weeks(); var asmins = moment.duration(500, "weeks").asWeeks();
輸出
momentjs_durations.htm
廣告