Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include isdsts field in data #1057

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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