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

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.6.2
4
+
5
+ - Adding `ifSeason` handlebar helper to make seasonal updates with JSON
6
+
3
7
  ## 3.5.7
4
8
 
5
9
  - Making `maxRecursion` for our file include plugin in template.js a lot higher
@@ -66,22 +66,22 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
66
66
  }
67
67
  }
68
68
  },
69
- // Check to see if seasonal updates
69
+ // Check to see if seasonal changes should be made
70
70
  {
71
71
  name: 'ifSeason',
72
72
  fn: function(season, block) {
73
73
  const today = new Date();
74
74
  const year = today.getFullYear();
75
- const startOfSpring = new Date(`03-14-${year}`);
76
- const startOfFall = new Date(`09-25-${year}`);
77
75
  let isSeason = false;
78
76
 
79
77
  switch(season) {
80
78
  case 'coolerWeather':
79
+ const startOfSpring = new Date(`03-14-${year}`);
80
+ const startOfFall = new Date(`09-25-${year}`);
81
81
  isSeason = !(today > startOfSpring && today < startOfFall);
82
82
  break
83
83
  }
84
- return isSeason ? block.fn(this) : block.fn(this);
84
+ return isSeason ? block.fn(this) : block.inverse(this);
85
85
  }
86
86
  },
87
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.17",
3
+ "version": "3.6.1--beta.19",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,19 +0,0 @@
1
- /**
2
- * Set Default Season Range
3
- * @returns {Boolean} - if true = update verbiage
4
- */
5
-
6
- var makeSeasonalUpdates = function(trade) {
7
- var trade = siteData.primary_trade;
8
- const today = new Date();
9
- const year = today.getFullYear();
10
- if (trade === 'HVAC') {
11
-
12
- }
13
-
14
- /* Default Hightlight Cooling Services; Highlight Heating Services from September 25 to March 14 */
15
- const springDate = new Date(`03-14-${year}`);
16
- const fallDate = new Date(`09-25-${year}`);
17
-
18
- return !(today > springDate && today < fallDate);
19
- }