You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/01/04 09:24:52 UTC

svn commit: r608771 - /myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/date.js

Author: skitching
Date: Fri Jan  4 00:24:51 2008
New Revision: 608771

URL: http://svn.apache.org/viewvc?rev=608771&view=rev
Log:
Sync with java master version: Add public method getDateForWeekDate. Rename a couple of methods.

Modified:
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/date.js

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/date.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/date.js?rev=608771&r1=608770&r2=608771&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/date.js (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/calendar/resource/date.js Fri Jan  4 00:24:51 2008
@@ -225,7 +225,7 @@
   return dow;  
 }
 
-proto._getJavaWeekDate = function(date, firstDayOfWeek)
+proto._getWeekDate = function(date, firstDayOfWeek)
 {
   var year = date.getFullYear();
   var month = date.getMonth() + 1;
@@ -304,7 +304,7 @@
   return weekYearStartMsecs;
 }
 
-proto._newJavaDateByWeekYear = function(
+proto._getDateForWeekDate = function(
   year, week, day,
   hour, min, sec,
   firstDayOfWeek)
@@ -338,7 +338,7 @@
   var date;
   if (context.weekOfWeekYear != 0)
   {
-    date = this._newJavaDateByWeekYear(
+    date = this._getDateForWeekDate(
       context.weekYear, context.weekOfWeekYear, context.day,
       context.hour, context.min, context.sec,
       context.firstDayOfWeek);
@@ -636,7 +636,7 @@
   
   context.ampm = (context.hour < 12) ? 0 : 1;
   
-  var weekDate = this._getJavaWeekDate(date, firstDayOfWeek);
+  var weekDate = this._getWeekDate(date, firstDayOfWeek);
   context.weekYear = weekDate.year;
   context.weekOfWeekYear = weekDate.week;
   
@@ -932,7 +932,12 @@
 
 proto.getWeekDate = function(date)
 {
-  return this._getJavaWeekDate(date, this.firstDayOfWeek);
+  return this._getWeekDate(date, this.firstDayOfWeek);
+}
+
+proto.getDateForWeekDate = function(wdate)
+{
+  return this._getDateForWeekDate(wdate.year, wdate.week, 1, 0, 0, 0, this.firstDayOfWeek);
 }
 
 } // end of static init block for SimpleDateFormatter class