PDA

View Full Version : Yesterday date



asmweb
16 Mar 2012, 6:18 AM
Hello,

I would like to know how could I get the yesterday date in Extjs. I have
dateToday: Ext.Date.format(new Date(), 'd/m/Y'), but what I would like is to have the yesterday date. If I do yesterdayDate: Ext.Date.format(new Date()-1, 'd/m/Y') errors are raised. Any hint?

Thanks

friend
16 Mar 2012, 6:24 AM
var d = new Date();
d.setTime(d.getTime() - (1000 * 60 * 60 * 24));

khmurach
16 Mar 2012, 6:29 AM
Ext.Date.add(new Date(), Ext.Date.DAY, -1)
Demo http://ext4all.com/post/yesterday-date