Skip to content

Commit

Permalink
Refactor describeDomainsUrl to use ISO date format
Browse files Browse the repository at this point in the history
  • Loading branch information
PatchesMaps committed Oct 29, 2024
1 parent ab1a71c commit 9663152
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/js/workers/dd.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ async function requestDescribeDomains(params) {
proj,
} = params;

const describeDomainsUrl = `https://gibs.earthdata.nasa.gov/wmts/${projDict[proj]}/best/1.0.0/${id}/default/250m/all/${startDate.split('T')[0]}--${endDate.split('T')[0]}.xml`;
const start = new Date(startDate).toISOString().replace('.000', '');
const end = new Date(endDate).toISOString().replace('.000', '');

const describeDomainsUrl = `https://gibs.earthdata.nasa.gov/wmts/${projDict[proj]}/best/1.0.0/${id}/default/250m/all/${start}--${end}.xml`;
const describeDomainsResponse = await fetch(describeDomainsUrl);
const describeDomainsText = await describeDomainsResponse.text();

return describeDomainsText;
}

Expand Down

0 comments on commit 9663152

Please sign in to comment.