Skip to content

Commit

Permalink
Include isdsts field in data
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanshar committed Apr 25, 2023
1 parent b155ef3 commit db2a6b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions tasks/data-collect.js
Expand Up @@ -20,6 +20,7 @@ module.exports = function (grunt) {
abbrs = [],
untils = [],
offsets = [],
isdsts = [],
countries = [];

lines.forEach(function (line) {
Expand All @@ -33,6 +34,11 @@ module.exports = function (grunt) {
offsets.push(+utc.diff(local, 'minutes', true).toFixed(4));
untils.push(+utc);
abbrs.push(parts[13]);

const index = parts.findIndex(element => element.includes("isdst"));
if (index !== -1) {
isdsts.push(parseInt(parts[index].split("=")[1]));
}
});

if (offsets.length === 0 && lines.length === 3 && lines[2].length === 0) {
Expand All @@ -58,12 +64,13 @@ module.exports = function (grunt) {
untils : untils,
offsets : offsets,
population : populations[name] | 0,
countries : countries
countries : countries,
isdsts: isdsts
});
});

grunt.file.write('temp/collect/' + version + '.json', JSON.stringify(data, null, 2));

grunt.log.ok('Collected data for ' + version);
});
};
};
3 changes: 2 additions & 1 deletion tasks/data-dedupe.js
Expand Up @@ -22,7 +22,8 @@ function dedupe(zone) {
untils : untils,
offsets : offsets,
population : zone.population,
countries : zone.countries
countries : zone.countries,
isdsts : zone.isdsts
};
}

Expand Down

0 comments on commit db2a6b4

Please sign in to comment.