Editorial Calendar - Version 0.5.4

Version Description

  • I think this should finally fix the date format bugs we've been having. Thanks for sticking with it guys.
Download this release

Release Info

Developer MaryVogt
Plugin Icon wp plugin Editorial Calendar
Version 0.5.4
Comparing to
See all releases

Code changes from version 0.5.3 to 0.5.4

Files changed (3) hide show
  1. edcal.js +9 -7
  2. edcal.php +1 -1
  3. readme.txt +7 -2
edcal.js CHANGED
@@ -67,6 +67,8 @@ var edcal = {
67
  */
68
  isMoving: false,
69
 
 
 
70
  /*
71
  This is the base URL we use to make AJAX calls back
72
  to the server. This value is set in code generated
@@ -744,7 +746,7 @@ var edcal = {
744
  issue by adding the spaces back before we parse.
745
  */
746
  getDayFromDayId: function(/*dayId*/ day) {
747
- return Date.parse(day.substring(0, 2) + '/' + day.substring(2, 4) + '/' + day.substring(4));
748
  },
749
 
750
  /*
@@ -1077,8 +1079,8 @@ var edcal = {
1077
  * We don't really let them set a time in the calendar, so we
1078
  * put a default post time of 10:00 AM.
1079
  */
1080
- var formattedDate = encodeURIComponent(edcal.getDayFromDayId(date).toString("yyyy-dd-MM") + " 10:00:00");
1081
- edcal.output("Creating post on: " + edcal.getDayFromDayId(date).toString("yyyy-dd-MM"));
1082
  var url = edcal.ajax_url + "&action=edcal_newdraft&date=" + formattedDate + "&title=" +
1083
  encodeURIComponent(title);
1084
 
@@ -1135,7 +1137,7 @@ var edcal = {
1135
  */
1136
  changeDate: function(/*string*/ newdate, /*Post*/ post) {
1137
  edcal.output('Changing the date of "' + post.title + '" to ' + newdate);
1138
- var newdateFormatted = edcal.getDayFromDayId(newdate).toString("yyyy-dd-MM");
1139
 
1140
  var postStatus = "";
1141
 
@@ -1157,7 +1159,7 @@ var edcal = {
1157
  was scheduled to get published in the future and they drag
1158
  it into the past we change the status to publish.
1159
  */
1160
- var compare = Date.parse(newdateFormatted).compareTo(Date.today());
1161
  if (compare === -1) {
1162
  if (post.status === "publish") {
1163
  postStatus = "publish";
@@ -1172,7 +1174,7 @@ var edcal = {
1172
 
1173
  var url = edcal.ajax_url + "&action=edcal_changedate&postid=" + post.id +
1174
  "&postStatus=" + postStatus +
1175
- "&newdate=" + newdateFormatted + "&olddate=" + edcal.getDayFromDayId(post.date).toString("yyyy-dd-MM");
1176
 
1177
  jQuery("#post-" + post.id).addClass("loadingclass");
1178
 
@@ -1236,7 +1238,7 @@ var edcal = {
1236
  edcal.cacheDates[from] = true;
1237
 
1238
 
1239
- var url = edcal.ajax_url + "&action=edcal_posts&from=" + from.toString("yyyy-MM-dd") + "&to=" + to.toString("yyyy-MM-dd");
1240
  edcal.output("Calling AJAX URL: " + url);
1241
 
1242
  jQuery("#loading").show();
67
  */
68
  isMoving: false,
69
 
70
+ wp_dateFormat: "yyyy-MM-dd",
71
+
72
  /*
73
  This is the base URL we use to make AJAX calls back
74
  to the server. This value is set in code generated
746
  issue by adding the spaces back before we parse.
747
  */
748
  getDayFromDayId: function(/*dayId*/ day) {
749
+ return Date.parseExact(day.substring(2, 4) + '/' + day.substring(0, 2) + '/' + day.substring(4), "MM/dd/yyyy");
750
  },
751
 
752
  /*
1079
  * We don't really let them set a time in the calendar, so we
1080
  * put a default post time of 10:00 AM.
1081
  */
1082
+ var formattedDate = encodeURIComponent(edcal.getDayFromDayId(date).toString(edcal.wp_dateFormat) + " 10:00:00");
1083
+ edcal.output("Creating post on: " + edcal.getDayFromDayId(date).toString(edcal.wp_dateFormat));
1084
  var url = edcal.ajax_url + "&action=edcal_newdraft&date=" + formattedDate + "&title=" +
1085
  encodeURIComponent(title);
1086
 
1137
  */
1138
  changeDate: function(/*string*/ newdate, /*Post*/ post) {
1139
  edcal.output('Changing the date of "' + post.title + '" to ' + newdate);
1140
+ var newdateFormatted = edcal.getDayFromDayId(newdate).toString(edcal.wp_dateFormat);
1141
 
1142
  var postStatus = "";
1143
 
1159
  was scheduled to get published in the future and they drag
1160
  it into the past we change the status to publish.
1161
  */
1162
+ var compare = Date.parseExact(newdateFormatted, edcal.wp_dateFormat).compareTo(Date.today());
1163
  if (compare === -1) {
1164
  if (post.status === "publish") {
1165
  postStatus = "publish";
1174
 
1175
  var url = edcal.ajax_url + "&action=edcal_changedate&postid=" + post.id +
1176
  "&postStatus=" + postStatus +
1177
+ "&newdate=" + newdateFormatted + "&olddate=" + edcal.getDayFromDayId(post.date).toString(edcal.wp_dateFormat);
1178
 
1179
  jQuery("#post-" + post.id).addClass("loadingclass");
1180
 
1238
  edcal.cacheDates[from] = true;
1239
 
1240
 
1241
+ var url = edcal.ajax_url + "&action=edcal_posts&from=" + from.toString(edcal.wp_dateFormat) + "&to=" + to.toString(edcal.wp_dateFormat);
1242
  edcal.output("Calling AJAX URL: " + url);
1243
 
1244
  jQuery("#loading").show();
edcal.php CHANGED
@@ -18,7 +18,7 @@
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
  Description: An editorial calendar for managing the dates of your WordPress posts
21
- Version: 0.5.3
22
  Author: Mary Vogt and Zack Grossbart
23
  Author URI: http://www.zackgrossbart.com
24
  */
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
  Description: An editorial calendar for managing the dates of your WordPress posts
21
+ Version: 0.5.4
22
  Author: Mary Vogt and Zack Grossbart
23
  Author URI: http://www.zackgrossbart.com
24
  */
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: MaryVogt, zgrossbart
3
  Tags: posts, post, calendar, AJAX, admin, administration
4
  Requires at least: 2.8.5
5
- Tested up to: 2.8.6
6
- Stable tag: 0.5.3
7
 
8
  Editorial calendar makes it possible to see all your posts and drag and drop them to manage your blog.
9
 
@@ -13,6 +13,8 @@ The editorial calendar lets WordPress administrators and editors manage the date
13
 
14
  This is the beta version and the first one ready for public use. Please help us make this plugin better by giving us <a href="mailto:zack@grossbart.com">feedback</a>.
15
 
 
 
16
  Features:
17
 
18
  1. See all of your posts and when they'll be posted.
@@ -61,6 +63,9 @@ If you use the plugin <a href="http://wordpress.org/extend/plugins/live-countdow
61
 
62
  == Changelog ==
63
 
 
 
 
64
  = 0.5.3 =
65
  * Fixed a date formatting bug when we update posts into the WordPress database
66
 
2
  Contributors: MaryVogt, zgrossbart
3
  Tags: posts, post, calendar, AJAX, admin, administration
4
  Requires at least: 2.8.5
5
+ Tested up to: 2.9.1
6
+ Stable tag: 0.5.4
7
 
8
  Editorial calendar makes it possible to see all your posts and drag and drop them to manage your blog.
9
 
13
 
14
  This is the beta version and the first one ready for public use. Please help us make this plugin better by giving us <a href="mailto:zack@grossbart.com">feedback</a>.
15
 
16
+ <a href="http://chrisg.org/drag-and-drop-post-scheduling-with-the-editorial-calendar-wordpress-plugin/">Chris Garret</a> liked the calendar so much he made a <a href="http://www.youtube.com/watch?v=F4BnQZsgtZc&feature=player_embedded" style="font-size: 1.25em">video</a> showing you how to use it. Thanks Chris!
17
+
18
  Features:
19
 
20
  1. See all of your posts and when they'll be posted.
63
 
64
  == Changelog ==
65
 
66
+ = 0.5.4 =
67
+ * I think this should finally fix the date format bugs we've been having. Thanks for sticking with it guys.
68
+
69
  = 0.5.3 =
70
  * Fixed a date formatting bug when we update posts into the WordPress database
71