Skip to content

Commit 7bb2857

Browse files
authored
Merge pull request #42 from JohnRDOrazio/generate-litejs-and-minify
Changes by create-pull-request action
2 parents dfb4d6d + 0edfa01 commit 7bb2857

File tree

3 files changed

+37
-35
lines changed

3 files changed

+37
-35
lines changed

jqClock-lite.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
* @timestamp defaults to clients current time, using the performance API
1212
* @timezone defaults to detection of client timezone, but can be passed in as a string such as "UTC-6" when using server generated timestamps
1313
* @locale defaults to navigator language else "en", possible values are: "af", "am", "ar", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "es", "et", "fa", "fi", "fr", "gu", "he", "hi", "hr", "hu", "id", "in", "it", "iw", "ja", "kn", "ko", "lt", "lv", "ml", "mo", "mr", "ms", "nb", "nl", "no", "pl", "pt", "ro", "ru", "sh", "sk", "sl", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "uk", "ur", "vi", "zh", "arb", "cmn", "cnr", "drw", "ekk", "fil", "lvs", "pes", "prs", "swc", "swh", "tnf", "zsm" (can optionally add region)
14-
* @calendar defaults to "true", possible value are: boolean "true" or "false"
15-
* @dateFormat defaults to Intl.DateTimeFormat options object { "dateStyle": "full" }; can take string with PHP style format characters; if set to false @calendar will be false
14+
* @dateFormat defaults to Intl.DateTimeFormat options object { "dateStyle": "full" }; can take string with PHP style format characters; if set to false will remove calendar output
1615
* @timeFormat defaults to Intl.DateTimeFormat options object { "timeStyle": "medium" }; can take string with PHP style format characters;
1716
* @isDST possible values are boolean `true` or `false`, if not passed in will be calculated based on client time (default)
1817
*
@@ -268,7 +267,10 @@ if (!Number.prototype.map) {
268267

269268
//TIMEZONE
270269
//Timezone identifier
271-
"e": ( clk ) => clk.myoptions.timezone,
270+
"e": ( clk ) => /(UTC|GMT)\+/.test( clk.myoptions.timezone ) ? clk.myoptions.timezone : new Intl.DateTimeFormat( clk.myoptions.locale, {
271+
timeZone: clk.myoptions.timezone,
272+
timeZoneName: "long"
273+
} ).formatToParts( clk.mytimestamp_sysdiff ).filter(e => e.type === 'timeZoneName')[0].value,
272274
//Whether or not the date is in daylight saving time
273275
"I": ( clk ) => clk.myoptions.isDST ? "DST" : "",
274276
//Difference to Greenwich time (GMT) in hours

jqClock-lite.min.js

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)