- MomentJS 教程
- MomentJS - 主頁
- MomentJS - 概覽
- MomentJS - 環境設定
- MomentJS - 簡介
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - 獲取器/設定器
- 操作日期和時間
- 格式化日期和時間
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - 持續時間
- MomentJS - 工具
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 實用資源
- MomentJS - 快速指南
- MomentJS - 實用資源
- MomentJS - 討論
MomentJS - 同期或晚於
此方法檢查某個時刻是否與另一個時刻相同或晚於。它返回真或假。
語法
moment().isSameOrAfter(Moment|String|Number|Date|Array); moment().isSameOrAfter(Moment|String|Number|Date|Array, String);
示例
var issameorafter = moment('2017-10-10').isSameOrAfter('2017-10-09');
輸出
我們可以在 isSameOrAfter() 中使用單位,支援的單位是年、月、周、天、小時、分鐘和秒。
示例
var issameorafter = moment('2017-10-10').isSameOrAfter('2017-10-09', 'year');
輸出
示例
var issameorafter = moment('2017-10-10').isSameOrAfter('2017-10-15', 'day');
輸出
momentjs_date_queries.htm
廣告