Skip to content

Commit

Permalink
Merge pull request #34 from add2cal/dev
Browse files Browse the repository at this point in the history
Dev v1.4.0
  • Loading branch information
jekuer committed Oct 15, 2022
2 parents f770173 + bbfdd9c commit 069958b
Show file tree
Hide file tree
Showing 369 changed files with 634 additions and 2,646 deletions.
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ sitemap.xml
# plus all the maker stuff, which is not already ignored for Git

tzdata/
api/*.ics
api/*/
api/
Makefile
*.c
*.tab
Expand Down
24 changes: 12 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const fs = require('fs');
const tzDbPlaceholder = /let tzlibZonesDB,(\s)*tzlibZonesDetailsDB = {};/gm;
const exportCodePlaceholder = /\/\/ PLACE EXPORT HERE/g;
const zoneNamesPlaceholder = /\['%%PLACE ZONE NAMES HERE%%'\]/g;
const tzDbContent = fs.readFileSync('./src/zonesdb.js', 'utf-8');
const tzNamesList = fs.readFileSync('./api/zones.json', 'utf-8');

function prepareFinalFile(content, exportPhrase = '') {
let newContent = content.replace(tzDbPlaceholder, tzDbContent).replace(zoneNamesPlaceholder, tzNamesList);
let newContent = content.replace(tzDbPlaceholder, tzDbContent);
// update export statement
if (exportPhrase != '') {
newContent = newContent.replace(
exportCodePlaceholder,
Expand All @@ -15,6 +14,10 @@ function prepareFinalFile(content, exportPhrase = '') {
} else {
newContent = newContent.replace(exportCodePlaceholder, '');
}
// remove regular comments
newContent = newContent.replace(/(^|(?<=;\s))\s*\/\/(?!\seslint).*$/gm, '');
// remove empty lines
newContent = newContent.replace(/^\s*$(?:\r\n?|\n)/gm, '');
return newContent;
}

Expand All @@ -32,17 +35,11 @@ module.exports = function (grunt) {
},
src: ['index.html'],
},
generatorJS: {
js: {
options: {
prefix: 'Version:.',
prefix: 'Version(.=..|:.)',
},
src: ['generator.js'],
},
mainJS: {
options: {
prefix: 'Version.=..',
},
src: ['src/tzlib.js'],
src: ['generator.js', 'src/tzlib.js'],
},
},
// cleans old built files
Expand Down Expand Up @@ -120,6 +117,9 @@ module.exports = function (grunt) {
compress: true,
mangle: true,
sourceMap: true,
output: {
comments: 'some',
},
},
newBuild: {
files: {
Expand Down
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Run ...
sudo sh update-tzdata.sh tzVersionNumber
```

... with _tzVersionNumber_ being the version of the IANA time zone database you want to use (e.g. sudo sh update-tzdata.sh 2022d).
... with _tzVersionNumber_ being the version of the [IANA time zone database](https://www.iana.org/time-zones) you want to use (e.g. sudo sh update-tzdata.sh 2022e).

<br />

Expand Down Expand Up @@ -165,6 +165,7 @@ Licensed under [Apache-2.0](LICENSE).

## ⚡ Changelog (without minor changes and fixes)

- v1.4 : further minification via data mapping
- v1.3 : bundle size optimization and API
- v1.2 : providing tzblock as array with separate tzid
- v1.1 : get-offset function
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Abidjan.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Abidjan
X-LIC-LOCATION:Africa/Abidjan
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:GMT
TZOFFSETFROM:+0000
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Algiers.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Algiers
X-LIC-LOCATION:Africa/Algiers
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0100
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Bissau.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Bissau
X-LIC-LOCATION:Africa/Bissau
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:GMT
TZOFFSETFROM:+0000
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Cairo.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Cairo
X-LIC-LOCATION:Africa/Cairo
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:EET
TZOFFSETFROM:+0200
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Casablanca.ics
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Casablanca
TZUNTIL:20870511T020001Z
X-LIC-LOCATION:Africa/Casablanca
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:+01
TZOFFSETFROM:+0100
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Ceuta.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Ceuta
X-LIC-LOCATION:Africa/Ceuta
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:DAYLIGHT
TZNAME:CEST
TZOFFSETFROM:+0100
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/El_Aaiun.ics
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/El_Aaiun
TZUNTIL:20870511T020001Z
X-LIC-LOCATION:Africa/El_Aaiun
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:+01
TZOFFSETFROM:+0100
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Johannesburg.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Johannesburg
X-LIC-LOCATION:Africa/Johannesburg
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:SAST
TZOFFSETFROM:+0200
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Juba.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Juba
X-LIC-LOCATION:Africa/Juba
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:CAT
TZOFFSETFROM:+0200
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Khartoum.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Khartoum
X-LIC-LOCATION:Africa/Khartoum
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:CAT
TZOFFSETFROM:+0200
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Lagos.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Lagos
X-LIC-LOCATION:Africa/Lagos
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:WAT
TZOFFSETFROM:+0100
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Maputo.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Maputo
X-LIC-LOCATION:Africa/Maputo
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:CAT
TZOFFSETFROM:+0200
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Monrovia.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Monrovia
X-LIC-LOCATION:Africa/Monrovia
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:GMT
TZOFFSETFROM:+0000
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Nairobi.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Nairobi
X-LIC-LOCATION:Africa/Nairobi
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:EAT
TZOFFSETFROM:+0300
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Ndjamena.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Ndjamena
X-LIC-LOCATION:Africa/Ndjamena
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:WAT
TZOFFSETFROM:+0100
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Sao_Tome.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Sao_Tome
X-LIC-LOCATION:Africa/Sao_Tome
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:GMT
TZOFFSETFROM:+0000
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Tripoli.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Tripoli
X-LIC-LOCATION:Africa/Tripoli
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:EET
TZOFFSETFROM:+0200
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Tunis.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Tunis
X-LIC-LOCATION:Africa/Tunis
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0100
Expand Down
2 changes: 1 addition & 1 deletion api/Africa/Windhoek.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/Africa/Windhoek
X-LIC-LOCATION:Africa/Windhoek
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:CAT
TZOFFSETFROM:+0200
Expand Down
2 changes: 1 addition & 1 deletion api/America/Adak.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Adak
X-LIC-LOCATION:America/Adak
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:DAYLIGHT
TZNAME:HDT
TZOFFSETFROM:-1000
Expand Down
2 changes: 1 addition & 1 deletion api/America/Anchorage.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Anchorage
X-LIC-LOCATION:America/Anchorage
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:DAYLIGHT
TZNAME:AKDT
TZOFFSETFROM:-0900
Expand Down
2 changes: 1 addition & 1 deletion api/America/Araguaina.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Araguaina
X-LIC-LOCATION:America/Araguaina
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Buenos_Aires.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Buenos_Aires
X-LIC-LOCATION:America/Argentina/Buenos_Aires
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Catamarca.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Catamarca
X-LIC-LOCATION:America/Argentina/Catamarca
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Cordoba.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Cordoba
X-LIC-LOCATION:America/Argentina/Cordoba
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Jujuy.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Jujuy
X-LIC-LOCATION:America/Argentina/Jujuy
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/La_Rioja.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/La_Rioja
X-LIC-LOCATION:America/Argentina/La_Rioja
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Mendoza.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Mendoza
X-LIC-LOCATION:America/Argentina/Mendoza
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Rio_Gallegos.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Rio_Gallegos
X-LIC-LOCATION:America/Argentina/Rio_Gallegos
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Salta.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Salta
X-LIC-LOCATION:America/Argentina/Salta
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/San_Juan.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/San_Juan
X-LIC-LOCATION:America/Argentina/San_Juan
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/San_Luis.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/San_Luis
X-LIC-LOCATION:America/Argentina/San_Luis
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Tucuman.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Tucuman
X-LIC-LOCATION:America/Argentina/Tucuman
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Argentina/Ushuaia.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Argentina/Ushuaia
X-LIC-LOCATION:America/Argentina/Ushuaia
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:STANDARD
TZNAME:-03
TZOFFSETFROM:-0300
Expand Down
2 changes: 1 addition & 1 deletion api/America/Asuncion.ics
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN:VTIMEZONE
TZID:/timezones-ical-library/America/Asuncion
X-LIC-LOCATION:America/Asuncion
LAST-MODIFIED:20220929T150625Z
LAST-MODIFIED:20221015T115821Z
BEGIN:DAYLIGHT
TZNAME:-03
TZOFFSETFROM:-0400
Expand Down
Loading

0 comments on commit 069958b

Please sign in to comment.