Update of /cvsroot/thyapi/thyapi/thywidgets
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26763/thywidgets
Modified Files:
thypopupcalendar.js
Log Message:
Commiting file additions and modification from SVN revision 2482 to 2483...
Changes made by vinicius on 2005-12-21 20:05:14 +0100 (Wed, 21 Dec 2005) corresponding to SVN revision 2483 with message:
JScalendar changes to include time
Index: thypopupcalendar.js
===================================================================
RCS file: /cvsroot/thyapi/thyapi/thywidgets/thypopupcalendar.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** thypopupcalendar.js 1 Sep 2005 18:15:38 -0000 1.1
--- thypopupcalendar.js 21 Dec 2005 18:12:42 -0000 1.2
***************
*** 61,64 ****
--- 61,68 ----
this.readOnly = true;
+
+ this.showsTime = false;
+ this.timeFormat = '24';
+ this.timeDisplayFormat = '';
this.onCreate(this.initThyPopupCalendar);
***************
*** 77,84 ****
Calendar.setup({
inputField: this.name+'_input',
! ifFormat: this.format,
button: this.calBtn,
onSelect: this._calendarOnSelect(),
! thyAPIObj: this
});
--- 81,90 ----
Calendar.setup({
inputField: this.name+'_input',
! ifFormat: this.format + this.timeDisplayFormat,
button: this.calBtn,
onSelect: this._calendarOnSelect(),
! thyAPIObj: this,
! showsTime: this.showsTime,
! timeFormat: this.timeFormat
});
***************
*** 97,101 ****
* Method: setFormat
*
! * Sets the default format for displaying
*
* Parameters:
--- 103,107 ----
* Method: setFormat
*
! * Sets the default Date format for displaying
*
* Parameters:
***************
*** 118,121 ****
--- 124,168 ----
/**
+ * Method: setTime
+ *
+ * Sets the time visualization properties
+ *
+ * This must be called before calendar creation
+ *
+ * Parameters:
+ *
+ * shows - Boolean, true let the time dialog be shown
+ * format - The format, can be '12' or '24'
+ */
+ p.setTime = function(shows,format)
+ {
+ if (format == null)
+ {
+ format = '24';
+ }
+
+ if (shows)
+ {
+ if (parseInt(format) == 12)
+ {
+ this.timeDisplayFormat = ' %I:%M %p'
+ }
+ else if (parseInt(format) == 24)
+ {
+ this.timeDisplayFormat = ' %H:%M'
+ }
+ }
+ else
+ {
+ this.timeDisplayFormat = '';
+ }
+
+ this.showsTime = shows;
+ this.timeFormat = format;
+
+ if (this.timestamp != null) this.populate(this.getTimestamp());
+ }
+
+ /**
* Method: getFormatted
*
***************
*** 128,132 ****
var date = new Date();
date.setTime(this.timestamp);
! return date.print(this.format);
}
--- 175,179 ----
var date = new Date();
date.setTime(this.timestamp);
! return date.print(this.format + this.timeDisplayFormat);
}
|