Extjs4 獲取到前一天的日期


Extjs4 獲取到前一天的日期

Extjs官方示例

Ext.Date

( date, interval, value ) : Date

Provides a convenient method for performing basic date arithmetic. This method does not modify the Date instance being called - it creates and returns a new Date instance containing the resulting date value.

Examples:

// Basic usage: var dt = Ext.Date.add(new Date('10/29/2006'), Ext.Date.DAY, 5); console.log(dt); // returns 'Fri Nov 03 2006 00:00:00' // Negative values will be subtracted: var dt2 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, -5); console.log(dt2); // returns 'Tue Sep 26 2006 00:00:00' // Decimal values can be used: var dt3 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, 1.25); console.log(dt3); // returns 'Mon Oct 02 2006 06:00:00'

//下面這是經過格式的獲取前一天的日期

Ext.Date.format(Ext.Date.add(new Date(),Ext.Date.DAY,-1),'Y-m-d')


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM