ppecher
ppecher

Reputation: 1988

Hardcoding datefield and timefield values

timefield0 = new Ext.TimeField({});
datefield0 = new Ext.DateField({});

timefield0.setValue('9am');
datefield0.setValue('2009-09-09');

This does not work. Specified hardcoded parameter strings, which display properly, are appreciated.

Upvotes: 0

Views: 1257

Answers (1)

ChrisR
ChrisR

Reputation: 14447

Your code is completely incorrect. There is no Ext.TimeField but an Ext.form.TimeField, same goes for the DateField. Try this

var timefield0 = new Ext.form.TimeField({ name: 'time', renderTo: Ext.getBody() });
var datefield0 = new Ext.form.DateField({ name: 'date', renderTo: Ext.getBody() });

timefield0.setValue('9am');
datefield0.setValue('2009-09-09');

Upvotes: 1

Related Questions