- MomentJS 教程
- MomentJS - 主頁
- MomentJS - 概覽
- MomentJS - 環境設定
- MomentJS - 簡介
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - Getter/Setter
- 操作日期和時間
- 格式化日期和時間
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - 時長
- MomentJS - 實用程式
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 實用資源
- MomentJS - 快速指南
- MomentJS - 實用資源
- MomentJS - 討論
MomentJS - 當月日期
該方法將獲取/設定當月日期。它接受 1-31 的輸入,如果大於提供的範圍,則會新增到下個月。
語法
moment().date(Number); moment().date(); moment().dates(Number); moment().dates();
示例
var m = moment().date(); // gets the current day of the month var d = moment().date(2); // sets the day of month as shown below var k = moment().date(40); //sets the day of month which is greater than the range so the output shows the next month as shown in the output
輸出
momentjs_getter_setter.htm
廣告