diff --git a/.ruby-version b/.ruby-version
index 0bee604..338a5b5 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.3.3
+2.6.6
diff --git a/app/assets/javascripts/local-time.js b/app/assets/javascripts/local-time.js
index d30e3e7..62fed29 100644
--- a/app/assets/javascripts/local-time.js
+++ b/app/assets/javascripts/local-time.js
@@ -1 +1 @@
-(function(){var t=this;(function(){(function(){var t=[].slice;this.LocalTime={config:{},run:function(){return this.getController().processElements()},process:function(){var e,n,r,a;for(n=1<=arguments.length?t.call(arguments,0):[],r=0,a=n.length;r11?"pm":"am")).toUpperCase();case"P":return i("time."+(c>11?"pm":"am"));case"S":return n(h,m);case"w":return u;case"y":return n(f%100,m);case"Y":return f;case"Z":return r(e)}})},n=function(t,e){switch(e){case"-":return t;default:return("0"+t).slice(-2)}},r=function(t){var e,n,r,a,i;return i=t.toString(),(e=null!=(n=i.match(/\(([\w\s]+)\)$/))?n[1]:void 0)?/\s/.test(e)?e.match(/\b(\w)/g).join(""):e:(e=null!=(r=i.match(/(\w{3,4})\s\d{4}$/))?r[1]:void 0)?e:(e=null!=(a=i.match(/(UTC[\+\-]\d+)/))?a[1]:void 0)?e:""}}.call(this),function(){e.CalendarDate=function(){function t(t,e,n){this.date=new Date(Date.UTC(t,e-1)),this.date.setUTCDate(n),this.year=this.date.getUTCFullYear(),this.month=this.date.getUTCMonth()+1,this.day=this.date.getUTCDate(),this.value=this.date.getTime()}return t.fromDate=function(t){return new this(t.getFullYear(),t.getMonth()+1,t.getDate())},t.today=function(){return this.fromDate(new Date)},t.prototype.equals=function(t){return(null!=t?t.value:void 0)===this.value},t.prototype.is=function(t){return this.equals(t)},t.prototype.isToday=function(){return this.is(this.constructor.today())},t.prototype.occursOnSameYearAs=function(t){return this.year===(null!=t?t.year:void 0)},t.prototype.occursThisYear=function(){return this.occursOnSameYearAs(this.constructor.today())},t.prototype.daysSince=function(t){if(t)return(this.date-t.date)/864e5},t.prototype.daysPassed=function(){return this.constructor.today().daysSince(this)},t}()}.call(this),function(){var t,n,r;n=e.strftime,r=e.translate,t=e.getI18nValue,e.RelativeTime=function(){function a(t){this.date=t,this.calendarDate=e.CalendarDate.fromDate(this.date)}return a.prototype.toString=function(){var t,e;return(e=this.toTimeElapsedString())?r("time.elapsed",{time:e}):(t=this.toWeekdayString())?(e=this.toTimeString(),r("datetime.at",{date:t,time:e})):r("date.on",{date:this.toDateString()})},a.prototype.toTimeOrDateString=function(){return this.calendarDate.isToday()?this.toTimeString():this.toDateString()},a.prototype.toTimeElapsedString=function(){var t,e,n,a,i;return n=(new Date).getTime()-this.date.getTime(),a=Math.round(n/1e3),e=Math.round(a/60),t=Math.round(e/60),n<0?null:a<10?(i=r("time.second"),r("time.singular",{time:i})):a<45?a+" "+r("time.seconds"):a<90?(i=r("time.minute"),r("time.singular",{time:i})):e<45?e+" "+r("time.minutes"):e<90?(i=r("time.hour"),r("time.singularAn",{time:i})):t<24?t+" "+r("time.hours"):""},a.prototype.toWeekdayString=function(){switch(this.calendarDate.daysPassed()){case 0:return r("date.today");case 1:return r("date.yesterday");case-1:return r("date.tomorrow");case 2:case 3:case 4:case 5:case 6:return n(this.date,"%A");default:return""}},a.prototype.toDateString=function(){var e;return e=t(this.calendarDate.occursThisYear()?"date.formats.thisYear":"date.formats.default"),n(this.date,e)},a.prototype.toTimeString=function(){return n(this.date,t("time.formats.default"))},a}()}.call(this),function(){var t,n=function(t,e){return function(){return t.apply(e,arguments)}};t=e.elementMatchesSelector,e.PageObserver=function(){function e(t,e){this.selector=t,this.callback=e,this.processInsertion=n(this.processInsertion,this),this.processMutations=n(this.processMutations,this)}return e.prototype.start=function(){if(!this.started)return this.observeWithMutationObserver()||this.observeWithMutationEvent(),this.started=!0},e.prototype.observeWithMutationObserver=function(){var t;if("undefined"!=typeof MutationObserver&&null!==MutationObserver)return t=new MutationObserver(this.processMutations),t.observe(document.documentElement,{childList:!0,subtree:!0}),!0},e.prototype.observeWithMutationEvent=function(){return addEventListener("DOMNodeInserted",this.processInsertion,!1),!0},e.prototype.findSignificantElements=function(e){var n;return n=[],(null!=e?e.nodeType:void 0)===Node.ELEMENT_NODE&&(t(e,this.selector)&&n.push(e),n.push.apply(n,e.querySelectorAll(this.selector))),n},e.prototype.processMutations=function(t){var e,n,r,a,i,o,s,u;for(e=[],n=0,a=t.length;n
- value = getValue(i18n[locale], keyPath)
+LocalTime.getI18nValue = (keyPath = "", { locale } = { locale: LocalTime.config.locale }) ->
+ value = getValue(LocalTime.config.i18n[locale], keyPath)
if value?
value
- else if locale isnt config.defaultLocale
- LocalTime.getI18nValue(keyPath, locale: config.defaultLocale)
+ else if locale isnt LocalTime.config.defaultLocale
+ LocalTime.getI18nValue(keyPath, { locale: LocalTime.config.defaultLocale })
LocalTime.translate = (keyPath, interpolations = {}, options) ->
string = LocalTime.getI18nValue(keyPath, options)
diff --git a/lib/assets/javascripts/src/local-time/helpers/strftime.coffee b/lib/assets/javascripts/src/local-time/helpers/strftime.coffee
index a6f331a..df18bbc 100644
--- a/lib/assets/javascripts/src/local-time/helpers/strftime.coffee
+++ b/lib/assets/javascripts/src/local-time/helpers/strftime.coffee
@@ -1,4 +1,4 @@
-{getI18nValue, translate} = LocalTime
+{ getI18nValue, translate } = LocalTime
LocalTime.strftime = strftime = (time, formatString) ->
day = time.getDay()
@@ -12,10 +12,10 @@ LocalTime.strftime = strftime = (time, formatString) ->
formatString.replace /%(-?)([%aAbBcdeHIlmMpPSwyYZ])/g, (match, flag, modifier) ->
switch modifier
when "%" then "%"
- when "a" then getI18nValue("date.abbrDayNames")[day]
- when "A" then getI18nValue("date.dayNames")[day]
- when "b" then getI18nValue("date.abbrMonthNames")[month]
- when "B" then getI18nValue("date.monthNames")[month]
+ when "a" then getI18nValue("date.abbr_day_names")[day]
+ when "A" then getI18nValue("date.day_names")[day]
+ when "b" then getI18nValue("date.abbr_month_names")[month + 1]
+ when "B" then getI18nValue("date.month_names")[month + 1]
when "c" then time.toString()
when "d" then pad(date, flag)
when "e" then date
diff --git a/lib/assets/javascripts/src/local-time/start.coffee b/lib/assets/javascripts/src/local-time/start.coffee
index 69be78c..6a530d5 100644
--- a/lib/assets/javascripts/src/local-time/start.coffee
+++ b/lib/assets/javascripts/src/local-time/start.coffee
@@ -11,7 +11,6 @@ nextFrame = (fn) ->
startController = ->
controller = LocalTime.getController()
- controller.start()
LocalTime.start = ->
unless started
@@ -20,6 +19,3 @@ LocalTime.start = ->
startController()
else
nextFrame(startController)
-
-if window.LocalTime is LocalTime
- LocalTime.start()