<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,7 +3,7 @@
 &lt;plist version=&quot;1.0&quot;&gt;
 &lt;dict&gt;
 	&lt;key&gt;currentDocument&lt;/key&gt;
-	&lt;string&gt;examples/dcalendar.html&lt;/string&gt;
+	&lt;string&gt;dist/jplus.js&lt;/string&gt;
 	&lt;key&gt;documents&lt;/key&gt;
 	&lt;array&gt;
 		&lt;dict&gt;
@@ -21,19 +21,33 @@
 	&lt;integer&gt;255&lt;/integer&gt;
 	&lt;key&gt;metaData&lt;/key&gt;
 	&lt;dict&gt;
+		&lt;key&gt;dist/jplus.js&lt;/key&gt;
+		&lt;dict&gt;
+			&lt;key&gt;caret&lt;/key&gt;
+			&lt;dict&gt;
+				&lt;key&gt;column&lt;/key&gt;
+				&lt;integer&gt;40&lt;/integer&gt;
+				&lt;key&gt;line&lt;/key&gt;
+				&lt;integer&gt;2858&lt;/integer&gt;
+			&lt;/dict&gt;
+			&lt;key&gt;firstVisibleColumn&lt;/key&gt;
+			&lt;integer&gt;0&lt;/integer&gt;
+			&lt;key&gt;firstVisibleLine&lt;/key&gt;
+			&lt;integer&gt;2807&lt;/integer&gt;
+		&lt;/dict&gt;
 		&lt;key&gt;examples/dcalendar.html&lt;/key&gt;
 		&lt;dict&gt;
 			&lt;key&gt;caret&lt;/key&gt;
 			&lt;dict&gt;
 				&lt;key&gt;column&lt;/key&gt;
-				&lt;integer&gt;43&lt;/integer&gt;
+				&lt;integer&gt;16&lt;/integer&gt;
 				&lt;key&gt;line&lt;/key&gt;
-				&lt;integer&gt;67&lt;/integer&gt;
+				&lt;integer&gt;19&lt;/integer&gt;
 			&lt;/dict&gt;
 			&lt;key&gt;firstVisibleColumn&lt;/key&gt;
 			&lt;integer&gt;0&lt;/integer&gt;
 			&lt;key&gt;firstVisibleLine&lt;/key&gt;
-			&lt;integer&gt;44&lt;/integer&gt;
+			&lt;integer&gt;10&lt;/integer&gt;
 		&lt;/dict&gt;
 		&lt;key&gt;src/core/object.js&lt;/key&gt;
 		&lt;dict&gt;
@@ -114,20 +128,21 @@
 			&lt;key&gt;caret&lt;/key&gt;
 			&lt;dict&gt;
 				&lt;key&gt;column&lt;/key&gt;
-				&lt;integer&gt;14&lt;/integer&gt;
+				&lt;integer&gt;1&lt;/integer&gt;
 				&lt;key&gt;line&lt;/key&gt;
-				&lt;integer&gt;14&lt;/integer&gt;
+				&lt;integer&gt;105&lt;/integer&gt;
 			&lt;/dict&gt;
 			&lt;key&gt;firstVisibleColumn&lt;/key&gt;
 			&lt;integer&gt;0&lt;/integer&gt;
 			&lt;key&gt;firstVisibleLine&lt;/key&gt;
-			&lt;integer&gt;0&lt;/integer&gt;
+			&lt;integer&gt;77&lt;/integer&gt;
 		&lt;/dict&gt;
 	&lt;/dict&gt;
 	&lt;key&gt;openDocuments&lt;/key&gt;
 	&lt;array&gt;
 		&lt;string&gt;examples/dcalendar.html&lt;/string&gt;
 		&lt;string&gt;src/utilities/dcalendar.js&lt;/string&gt;
+		&lt;string&gt;dist/jplus.js&lt;/string&gt;
 		&lt;string&gt;src/core/object.js&lt;/string&gt;
 		&lt;string&gt;src/native/string.js&lt;/string&gt;
 		&lt;string&gt;src/native/hash.js&lt;/string&gt;</diff>
      <filename>jplus.tmproj</filename>
    </modified>
    <modified>
      <diff>@@ -50,10 +50,10 @@ DCalendar.core = Class.create({
 	
 	initialize: function(options) {
 		this.options = Object.extend(this.options, options || {});
-		this.curr_day = Date.now();
-		this.year = this.curr_day.year();
-		this.month = this.curr_day.month();
-		this.day =  this.curr_day.day();
+		this.curr_day = {};
+		this.year = {};
+		this.month = {};
+		this.day = {};
 		
 		var _wrapper = this.options.wrapper ? this.options.wrapper : document;
 		var divs = _wrapper.getElementsByTagName('div');
@@ -62,6 +62,12 @@ DCalendar.core = Class.create({
 				div = $(div);
 				div.setAttribute('DCID', div.get('DCID') || DCalendar.DCID++);
 				div.id = 'dcid_' + div.get('DCID');
+				
+				this.curr_day[div.id] = Date.now();
+				this.year[div.id] = this.curr_day[div.id].year();
+				this.month[div.id] = this.curr_day[div.id].month();
+				this.day[div.id] = this.curr_day[div.id].day();
+				
 				this.mode[div.id] = 0;
 				this.status[div.id] = {};
 				this.selected_cache[div.id] = {};
@@ -153,9 +159,9 @@ DCalendar.core = Class.create({
 	
 	is_status: function(day, month, year, container) {
 		container = container || this.defaultc;
-		day = day || this.day;
-		month = month || this.month;
-		year = year || this.year;
+		day = day || this.day[container.id];
+		month = month || this.month[container.id];
+		year = year || this.year[container.id];
 		
 		var _status = new Hash(this.status[container.id]);
 		var _result = [false, null];
@@ -177,9 +183,9 @@ DCalendar.core = Class.create({
 	
 	is_available: function(day, month, year, container) {
 		container = container || this.defaultc;
-		day = day || this.day;
-		month = month || this.month;
-		year = year || this.year;
+		day = day || this.day[container.id];
+		month = month || this.month[container.id];
+		year = year || this.year[container.id];
 		
 		if (this.available_cache[container.id][year + '-' + month.toPaddedString(2)])
 			return this.available_cache[container.id][year + '-' + month.toPaddedString(2)].include(day);
@@ -189,9 +195,9 @@ DCalendar.core = Class.create({
 	
 	is_gray: function(day, month, year, container) {
 		container = container || this.defaultc;
-		day = day || this.day;
-		month = month || this.month;
-		year = year || this.year;
+		day = day || this.day[container.id];
+		month = month || this.month[container.id];
+		year = year || this.year[container.id];
 		
 		if (this.gray_cache[container.id][year + '-' + month.toPaddedString(2)])
 			return this.gray_cache[container.id][year + '-' + month.toPaddedString(2)].include(day);
@@ -209,10 +215,10 @@ DCalendar.core = Class.create({
 	
 	change_to_date: function(date) {
 		this.fireEvent('onMonthChange');
-		this.curr_day = date;
-		this.year = this.curr_day.year();
-		this.month = this.curr_day.month();
-		this.day =  this.curr_day.day();
+		this.curr_day[this.defaultc.id] = date;
+		this.year[this.defaultc.id] = this.curr_day[this.defaultc.id].year();
+		this.month[this.defaultc.id] = this.curr_day[this.defaultc.id].month();
+		this.day[this.defaultc.id] =  this.curr_day[this.defaultc.id].day();
 		this.create();
 		this.refresh_selected();
 	},
@@ -227,9 +233,9 @@ DCalendar.core = Class.create({
 	
 	is_saled: function(day, month, year, container) {
 		container = container || this.defaultc;
-		day = day || this.day;
-		month = month || this.month;
-		year = year || this.year;
+		day = day || this.day[container.id];
+		month = month || this.month[container.id];
+		year = year || this.year[container.id];
 		
 		if (this.mode[container.id] == 0) {
 			return this.is_gray(day, month, year, container);
@@ -240,9 +246,9 @@ DCalendar.core = Class.create({
 	
 	day_status: function(day, month, year, container) {
 		container = container || this.defaultc;
-		day = day || this.day;
-		month = month || this.month;
-		year = year || this.year;
+		day = day || this.day[container.id];
+		month = month || this.month[container.id];
+		year = year || this.year[container.id];
 		
 		var _status = this.is_status(day, month, year, container);
 		if (_status[0])
@@ -253,11 +259,11 @@ DCalendar.core = Class.create({
 	
 	create: function() {
 		this.before_create();
-		var _days = this.get_month_days(this.month-1);
-		var _html = '&lt;table class=&quot;dcalendar&quot; border=&quot;0&quot; cellspacing=&quot;1&quot; cellpadding=&quot;4&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;dcal-title&quot;&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;a href=&quot;#&quot; id=&quot;' + this.defaultc.id + '_prev&quot;&gt;&#19978;&#19968;&#26376;&lt;/a&gt;&lt;/td&gt;&lt;td colspan=&quot;' + (_days-6) + '&quot;&gt;' + this.curr_day.strftime('%Y&#24180;%m&#26376;') + '&lt;/td&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;a href=&quot;#&quot; id=&quot;' + this.defaultc.id + '_next&quot;&gt;&#19979;&#19968;&#26376;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;dcal-days&quot; id=&quot;' + this.defaultc.id + '_days&quot;&gt;';
+		var _days = this.get_month_days(this.month[this.defaultc.id]-1);
+		var _html = '&lt;table class=&quot;dcalendar&quot; border=&quot;0&quot; cellspacing=&quot;1&quot; cellpadding=&quot;4&quot;&gt;&lt;tbody&gt;&lt;tr class=&quot;dcal-title&quot;&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;a href=&quot;#&quot; id=&quot;' + this.defaultc.id + '_prev&quot;&gt;&#19978;&#19968;&#26376;&lt;/a&gt;&lt;/td&gt;&lt;td colspan=&quot;' + (_days-6) + '&quot;&gt;' + this.curr_day[this.defaultc.id].strftime('%Y&#24180;%m&#26376;') + '&lt;/td&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;a href=&quot;#&quot; id=&quot;' + this.defaultc.id + '_next&quot;&gt;&#19979;&#19968;&#26376;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;dcal-days&quot; id=&quot;' + this.defaultc.id + '_days&quot;&gt;';
 		_days.times(function(i) {
-			var _is_status = this.is_status(i+1, this.month, this.year);
-			_html += '&lt;td st=&quot;' + (this.is_saled(i+1, this.month, this.year) ? 'saled' : (_is_status[0] ? _is_status[2] + '&quot; realst=&quot;' + _is_status[2] : 'available')) + '&quot; id=&quot;' + this.defaultc.id + '_days_' + (i + 1) + '&quot;' + (this.is_saled(i+1, this.month, this.year) ? ' class=&quot;saled&quot;' : this.day_status(i+1, this.month, this.year)) + '&gt;' + (i + 1) + '&lt;/td&gt;';
+			var _is_status = this.is_status(i+1, this.month[this.defaultc.id], this.year[this.defaultc.id]);
+			_html += '&lt;td st=&quot;' + (this.is_saled(i+1, this.month[this.defaultc.id], this.year[this.defaultc.id]) ? 'saled' : (_is_status[0] ? _is_status[2] + '&quot; realst=&quot;' + _is_status[2] : 'available')) + '&quot; id=&quot;' + this.defaultc.id + '_days_' + (i + 1) + '&quot;' + (this.is_saled(i+1, this.month[this.defaultc.id], this.year[this.defaultc.id]) ? ' class=&quot;saled&quot;' : this.day_status(i+1, this.month[this.defaultc.id], this.year[this.defaultc.id])) + '&gt;' + (i + 1) + '&lt;/td&gt;';
 		}, this);
 		_html += '&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div id=&quot;' + this.defaultc.id + '_selected&quot; class=&quot;dcal-selected&quot;&gt;&lt;/div&gt;';
 		this.defaultc.innerHTML = _html;
@@ -273,13 +279,13 @@ DCalendar.core = Class.create({
 		
 		prev.observe('click', function(e) {
 			_dcal.set_default($(this.id.split('_').slice(0, 2).join('_')));
-			_dcal.change_to_date(_dcal.curr_day.after('Month', -1));
+			_dcal.change_to_date(_dcal.curr_day[_dcal.defaultc.id].after('Month', -1));
 			return false;
 		});
 		
 		next.observe('click', function(e) {
 			_dcal.set_default($(this.id.split('_').slice(0, 2).join('_')));
-			_dcal.change_to_date(_dcal.curr_day.after('Month', 1));
+			_dcal.change_to_date(_dcal.curr_day[_dcal.defaultc.id].after('Month', 1));
 			return false;
 		});
 		
@@ -344,17 +350,17 @@ DCalendar.core = Class.create({
 	
 	refresh_selected: function(container) {
 		container = container || this.defaultc;
-		this.format_cache(this.selected_cache[container.id][this.year + '-' + this.month]);
+		this.format_cache(this.selected_cache[container.id][this.year[container.id] + '-' + this.month[container.id]]);
 	},
 	
 	set_cache: function(container) {
 		container = container || this.defaultc;
-		var _days = this.days_of_month[this.month-1], _selected = '';
+		var _days = this.days_of_month[this.month[container.id]-1], _selected = '';
 		(_days).times(function(i) {
 			var _td = $i(this.defaultc.id + '_days_' + (i + 1));
 			_selected += _td.className == 'selected' ? '1' : '0';
 		}, this);
-		this.selected_cache[container.id][this.year + '-' + this.month] = _selected;
+		this.selected_cache[container.id][this.year[container.id] + '-' + this.month[container.id]] = _selected;
 		this.dump();
 	},
 	
@@ -376,15 +382,15 @@ DCalendar.core = Class.create({
 	
 	format_cache: function(cache, year, month, is_append) {
 		is_append = is_append || true;
-		year = year || this.year;
-		month = month || this.month;
+		year = year || this.year[this.defaultc.id];
+		month = month || this.month[this.defaultc.id];
 		if (!$defined(cache)) return;
 		var _start = '', _end = '', _days = cache.length, _sel_wrapper = $i(this.defaultc.id + '_selected'), _result = '';
 		_sel_wrapper.innerHTML = '';
 		(_days).times(function(i) {
 			if (cache.charAt(i) == '1') {
 				var _the_day = year + '-' + month.toPaddedString(2) + '-' + (i + 1).toPaddedString(2);
-				if (is_append &amp;&amp; month == this.month) $i(this.defaultc.id + '_days_' + (i + 1)).className = 'selected';
+				if (is_append &amp;&amp; month == this.month[this.defaultc.id]) $i(this.defaultc.id + '_days_' + (i + 1)).className = 'selected';
 				if (_start == '') {
 					_start = _the_day;
 				} else {
@@ -413,7 +419,7 @@ DCalendar.core = Class.create({
 	
 	get_month_days: function(month) {
 		var _days = this.days_of_month[month];
-		if (month==1 &amp;&amp; (this.year%4==0 &amp;&amp; this.year%100!=0 || this.year%400==0)) _days++;
+		if (month==1 &amp;&amp; (this.year[this.defaultc.id]%4==0 &amp;&amp; this.year[this.defaultc.id]%100!=0 || this.year[this.defaultc.id]%400==0)) _days++;
 		return _days;
 	}
 	</diff>
      <filename>src/utilities/dcalendar.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>354dd668140ced0420ab0f20045bd90de775468c</id>
    </parent>
  </parents>
  <author>
    <name>nowa</name>
    <email>nowa@nowa-mbp.local</email>
  </author>
  <url>http://github.com/nowa/jplus/commit/e689168078179fd3a37a5e3397da004e6526708c</url>
  <id>e689168078179fd3a37a5e3397da004e6526708c</id>
  <committed-date>2008-08-14T02:22:17-07:00</committed-date>
  <authored-date>2008-08-14T02:22:17-07:00</authored-date>
  <message>&#20462;&#22797;&#24403;&#21478;&#19968;&#20010;calendar&#25913;&#21464;&#26376;&#20221;&#21518;&#20854;&#23427;&#30340;&#20063;&#25913;&#21464;&#30340;bug</message>
  <tree>b2e5582d7f5529f67e39c5e6361b213526d7e14a</tree>
  <committer>
    <name>nowa</name>
    <email>nowa@nowa-mbp.local</email>
  </committer>
</commit>
