kaydensigh / chromecalclock

A calendar and clock widget.
Apache License 2.0
19 stars 7 forks source link

Dependency on removed Intl API #9

Closed littledan closed 8 years ago

littledan commented 8 years ago

In Chrome 53, certain Chrome-specific internationalization (Intl) APIs were removed. That change resulted in this application crashing on startup. Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=617122 .

The affected code is at https://github.com/kaydensigh/chromecalclock/blob/a4ee118e6c110771b88b442466033c38b9fec015/app/background.js#L7 . Here, Intl.DateTimeFormat.prototype.resolved.pattern is used to find whether the clock is in 24-hour mode or not. Instead, you can use Intl.DateTimeFormat.prototype.resolvedOptions().hour12 for the same purpose: true indicates 12-hour and false indicates 24-hour.

kaydensigh commented 8 years ago

Thanks for the detailed report! I've applied your suggested fix here: https://github.com/kaydensigh/chromecalclock/commit/5276fdf751cb7dec47669fe3ddc2c58ddbf70a36

littledan commented 8 years ago

Thanks, and sorry for the churn!