FIX: Fix constants task and run update it (#153)

diff --git a/assets/javascripts/lib/regions.js.es6 b/assets/javascripts/lib/regions.js.es6
index c229e92..2f8fba0 100644
--- a/assets/javascripts/lib/regions.js.es6
+++ b/assets/javascripts/lib/regions.js.es6
@@ -21,6 +21,8 @@ export const HOLIDAY_REGIONS = [
   "be_fr",
   "be_nl",
   "br",
+  "br_spcapital",
+  "br_sp",
   "bg_en",
   "bg_bg",
   "ca",
@@ -148,6 +150,7 @@ export const HOLIDAY_REGIONS = [
   "it_bl",
   "it_ro",
   "kr",
+  "kz",
   "li",
   "lt",
   "lv",
@@ -270,7 +273,6 @@ export const TIME_ZONE_TO_REGION = {
   "Australia/Lord_Howe": "au",
   "Antarctica/Macquarie": "au",
   "Australia/Hobart": "au",
-  "Australia/Currie": "au",
   "Australia/Melbourne": "au",
   "Australia/Sydney": "au",
   "Australia/Broken_Hill": "au",
@@ -321,9 +323,9 @@ export const TIME_ZONE_TO_REGION = {
   "America/Creston": "ca",
   "America/Dawson_Creek": "ca",
   "America/Fort_Nelson": "ca",
-  "America/Vancouver": "ca",
   "America/Whitehorse": "ca",
   "America/Dawson": "ca",
+  "America/Vancouver": "ca",
   "Europe/Zurich": "ch",
   "America/Santiago": "cl",
   "America/Punta_Arenas": "cl",
@@ -349,6 +351,13 @@ export const TIME_ZONE_TO_REGION = {
   "Europe/Rome": "it",
   "Asia/Tokyo": "jp",
   "Asia/Seoul": "kr",
+  "Asia/Almaty": "kz",
+  "Asia/Qyzylorda": "kz",
+  "Asia/Qostanay": "kz",
+  "Asia/Aqtobe": "kz",
+  "Asia/Aqtau": "kz",
+  "Asia/Atyrau": "kz",
+  "Asia/Oral": "kz",
   "Europe/Vilnius": "lt",
   "Europe/Luxembourg": "lu",
   "Europe/Riga": "lv",
@@ -382,8 +391,8 @@ export const TIME_ZONE_TO_REGION = {
   "Europe/Moscow": "ru",
   "Europe/Simferopol": "ru",
   "Europe/Kirov": "ru",
-  "Europe/Astrakhan": "ru",
   "Europe/Volgograd": "ru",
+  "Europe/Astrakhan": "ru",
   "Europe/Saratov": "ru",
   "Europe/Ulyanovsk": "ru",
   "Europe/Samara": "ru",
diff --git a/lib/tasks/javascript.rake b/lib/tasks/javascript.rake
index 2295378..b910e0b 100644
--- a/lib/tasks/javascript.rake
+++ b/lib/tasks/javascript.rake
@@ -5,6 +5,8 @@ UNUSED_REGIONS = ["ecbtarget", "federalreserve", "federalreservebanks", "fedex",
 HOLIDAYS_COUNTRY_OVERRIDES = { "gr" => "el" }
 
 task 'javascript:update_constants' => :environment do
+  require 'holidays' if !defined?(Holidays)
+
   holiday_regions = Holidays.available_regions.map(&:to_s) - UNUSED_REGIONS
 
   time_zone_to_region = {}
@@ -19,7 +21,7 @@ task 'javascript:update_constants' => :environment do
     time_zone_to_region[timezone] = country_code
   end
 
-  write_template("../../../plugins/discourse-calendar/assets/javascripts/lib/regions.js.es6", <<~JS)
+  write_template("../../../plugins/discourse-calendar/assets/javascripts/lib/regions.js.es6", 'update_constants', <<~JS)
     export const HOLIDAY_REGIONS = #{holiday_regions.to_json};
 
     export const TIME_ZONE_TO_REGION = #{time_zone_to_region.to_json};

GitHub sha: db358d7a8f7037f7acb18cf0f1983963f16e763a

This commit appears in #153 which was merged by Falco.