mod-build 3.6.1--beta.15 → 3.6.1--beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,20 +66,22 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
66
66
  }
67
67
  }
68
68
  },
69
+ // Check to see if seasonal updates
69
70
  {
70
- name: 'makeSeasonalUpdates',
71
- fn: function(season) {
72
- var trade = siteData.primary_trade;
71
+ name: 'ifSeason',
72
+ fn: function(season, block) {
73
73
  const today = new Date();
74
74
  const year = today.getFullYear();
75
- if (season === 'coolerWeather') {
76
- /* Default Hightlight Cooling Services; Highlight Heating Services from September 25 to March 14 */
77
- const springDate = new Date(`03-14-${year}`);
78
- const fallDate = new Date(`09-25-${year}`);
75
+ const startOfSpring = new Date(`03-14-${year}`);
76
+ const startOfFall = new Date(`09-25-${year}`);
77
+ let isSeason = false;
79
78
 
80
- return !(today > springDate && today < fallDate);
79
+ switch(season) {
80
+ case 'coolerWeather':
81
+ isSeason = !(today > startOfSpring && today < startOfFall);
82
+ break
81
83
  }
82
-
84
+ return isSeason ? block.fn(this) : block.fn(this);
83
85
  }
84
86
  },
85
87
  // Convert string to uppercase
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.1--beta.15",
3
+ "version": "3.6.1--beta.17",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"