can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r20415: LJSUP-10215: Incorrect date in Calendar ...

Committer: dpetrov
LJSUP-10215: Incorrect date in Calendar when create post in Future
U   trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2011-10-24 10:35:58 UTC (rev 20414)
+++ trunk/htdocs/js/entry.js	2011-10-24 10:47:49 UTC (rev 20415)
@@ -28,7 +28,7 @@
 	customTimeFlag.val('1');
 
 	f = document.updateForm;
-	var month = f.date_ymd_mm.selectedIndex || f.date_ymd_mm.value;
+	var month = f.date_ymd_mm.value;
 	var dateStr = f.date_ymd_yyyy.value + "/" + month + "/" + f.date_ymd_dd.value;
 
 	cal.calendar({
@@ -662,7 +662,7 @@
 	}
 
 	f.date_ymd_yyyy.value = newTime.getFullYear() < 1900 ? newTime.getFullYear() + 1900 : newTime.getFullYear();
-	f.date_ymd_mm.selectedIndex = newTime.getMonth();
+	f.date_ymd_mm.value = newTime.getMonth() + 1;
 	f.date_ymd_dd.value = twodigit(newTime.getDate());
 	if (!time) {
 		f.hour.value = twodigit(newTime.getHours());

Tags: can3p, dpetrov, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments