projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
whitespace
[roojs1]
/
Roo
/
bootstrap
/
DateField.js
diff --git
a/Roo/bootstrap/DateField.js
b/Roo/bootstrap/DateField.js
index
0a8767a
..
ba18ac3
100644
(file)
--- a/
Roo/bootstrap/DateField.js
+++ b/
Roo/bootstrap/DateField.js
@@
-227,7
+227,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
this.showMode();
if(this.isInline) {
this.showMode();
if(this.isInline) {
- this.show();
+ this.show
Popup
();
}
},
}
},
@@
-342,7
+342,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
this.picker().select('>.datepicker-days tbody',true).first().dom.innerHTML = '';
this.picker().select('>.datepicker-days tbody',true).first().dom.innerHTML = '';
- while(prevMonth.valueOf() < nextMonth) {
+ while(prevMonth.valueOf() <
=
nextMonth) {
var clsName = '';
if (prevMonth.getUTCDay() === this.weekStart) {
var clsName = '';
if (prevMonth.getUTCDay() === this.weekStart) {
@@
-510,7
+510,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
onFocus : function()
{
Roo.bootstrap.DateField.superclass.onFocus.call(this);
onFocus : function()
{
Roo.bootstrap.DateField.superclass.onFocus.call(this);
- this.show();
+ this.show
Popup
();
},
onBlur : function()
},
onBlur : function()
@@
-521,19
+521,19
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
this.setValue(d);
this.setValue(d);
- this.hide();
+ this.hide
Popup
();
},
},
- show : function()
+ show
Popup
: function()
{
this.picker().show();
this.update();
this.place();
{
this.picker().show();
this.update();
this.place();
- this.fireEvent('show', this, this.date);
+ this.fireEvent('show
popup
', this, this.date);
},
},
- hide : function()
+ hide
Popup
: function()
{
if(this.isInline) {
return;
{
if(this.isInline) {
return;
@@
-542,7
+542,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
this.viewMode = this.startViewMode;
this.showMode();
this.viewMode = this.startViewMode;
this.showMode();
- this.fireEvent('hide', this, this.date);
+ this.fireEvent('hide
popup
', this, this.date);
},
},
@@
-590,7
+590,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
{
if (!this.picker().isVisible()){
if (e.keyCode == 27) { // allow escape to hide and re-show picker
{
if (!this.picker().isVisible()){
if (e.keyCode == 27) { // allow escape to hide and re-show picker
- this.show();
+ this.show
Popup
();
}
return;
}
}
return;
}
@@
-601,7
+601,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
switch(e.keyCode){
case 27: // escape
switch(e.keyCode){
case 27: // escape
- this.hide();
+ this.hide
Popup
();
e.preventDefault();
break;
case 37: // left
e.preventDefault();
break;
case 37: // left
@@
-661,19
+661,19
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
break;
case 13: // enter
this.setValue(this.formatDate(this.date));
break;
case 13: // enter
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hide
Popup
();
e.preventDefault();
break;
case 9: // tab
this.setValue(this.formatDate(this.date));
e.preventDefault();
break;
case 9: // tab
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hide
Popup
();
break;
case 16: // shift
case 17: // ctrl
case 18: // alt
break;
default :
break;
case 16: // shift
case 17: // ctrl
case 18: // alt
break;
default :
- this.hide();
+ this.hide
Popup
();
}
},
}
},
@@
-721,13
+721,16
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
// this.fill()
this.setValue(this.formatDate(this.date));
// this.fill()
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hide
Popup
();
break;
}
break;
case 'span':
if (className.indexOf('disabled') < 0) {
break;
}
break;
case 'span':
if (className.indexOf('disabled') < 0) {
- this.viewDate.setUTCDate(1);
+ if (!this.viewDate) {
+ this.viewDate = new Date();
+ }
+ this.viewDate.setUTCDate(1);
if (className.indexOf('month') > -1) {
this.viewDate.setUTCMonth(Roo.bootstrap.DateField.dates[this.language].monthsShort.indexOf(html));
} else {
if (className.indexOf('month') > -1) {
this.viewDate.setUTCMonth(Roo.bootstrap.DateField.dates[this.language].monthsShort.indexOf(html));
} else {
@@
-738,7
+741,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
if(this.singleMode){
this.setValue(this.formatDate(this.viewDate));
if(this.singleMode){
this.setValue(this.formatDate(this.viewDate));
- this.hide();
+ this.hide
Popup
();
return;
}
return;
}
@@
-751,8
+754,8
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
//Roo.log(className);
if (className.indexOf('day') > -1 && className.indexOf('disabled') < 0 ){
var day = parseInt(html, 10) || 1;
//Roo.log(className);
if (className.indexOf('day') > -1 && className.indexOf('disabled') < 0 ){
var day = parseInt(html, 10) || 1;
- var year =
this.viewDate
.getUTCFullYear(),
- month =
this.viewDate
.getUTCMonth();
+ var year =
(this.viewDate || new Date())
.getUTCFullYear(),
+ month =
(this.viewDate || new Date())
.getUTCMonth();
if (className.indexOf('old') > -1) {
if(month === 0 ){
if (className.indexOf('old') > -1) {
if(month === 0 ){
@@
-775,7
+778,7
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
// this.fill();
//Roo.log(this.formatDate(this.date));
this.setValue(this.formatDate(this.date));
// this.fill();
//Roo.log(this.formatDate(this.date));
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hide
Popup
();
}
break;
}
}
break;
}
@@
-930,6
+933,10
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
validateValue : function(value)
{
validateValue : function(value)
{
+ if(this.getVisibilityEl().hasClass('hidden')){
+ return true;
+ }
+
if(value.length < 1) {
if(this.allowBlank){
return true;
if(value.length < 1) {
if(this.allowBlank){
return true;
@@
-974,6
+981,13
@@
Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input, {
return true;
return true;
+ },
+
+ reset : function()
+ {
+ this.date = this.viewDate = '';
+
+ Roo.bootstrap.DateField.superclass.setValue.call(this, '');
}
});
}
});
@@
-1072,7
+1086,7
@@
Roo.apply(Roo.bootstrap.DateField, {
template : {
tag: 'div',
template : {
tag: 'div',
- cls: 'datepicker dropdown-menu roo-dynamic',
+ cls: 'datepicker dropdown-menu roo-dynamic
shadow
',
cn: [
{
tag: 'div',
cn: [
{
tag: 'div',