-
20 Dec 2011 6:04 AM #1
Display only Current date in date field
Display only Current date in date field
Hello guys
I am using Extjs 3. I have a window in which i have used
It is showing full calender. I have only one date field in which i have to display current date as default in this datefield when ever i run the application. It has to show only today's date i.e., current date in this field. Please help me out about this issue.Code:{ xtype:'datefield', fieldLabel:'created Date', allowBlank:false, id:'createddate', vtype: 'daterange', format:'d-m-Y', name:'apojo.dstart' }
Thanks in advance
Samarth Manjunath
-
20 Dec 2011 6:24 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
So you don't want the date picker to show? To get today's date in there, set the value to new Date()
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Dec 2011 11:09 PM #3
display only current date in date field
display only current date in date field
hello Mitchell Simoens
It will automatically update to the system date know???
-
21 Dec 2011 5:45 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
If you set
It will use the current date/time on the user's computerCode:value : new Date()
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
21 Dec 2011 8:38 PM #5
display current date
display current date
Hello Mitchell Simoens,
Thank you. Its working fine Mitchell.
-
2 Nov 2012 7:33 AM #6
you can also set the date to show in the controller, probably in the new/load action for the view.
(assuming the view is a form)
formname.findField("NAME OF FIELD").setValue(new Date());
in your case:
formname.findField("apojo.dstart").setValue(new Date());


Reply With Quote