Skip to content

Commit

Permalink
add new data years, remove old ones
Browse files Browse the repository at this point in the history
  • Loading branch information
mraguso2 committed Dec 21, 2024
1 parent dc2c49c commit 9b5b0a7
Show file tree
Hide file tree
Showing 9 changed files with 43,857 additions and 59,903 deletions.
11,334 changes: 0 additions & 11,334 deletions Data/2020data.json

This file was deleted.

11,310 changes: 0 additions & 11,310 deletions Data/2021data.json

This file was deleted.

11,302 changes: 0 additions & 11,302 deletions Data/2022data.json

This file was deleted.

11,310 changes: 0 additions & 11,310 deletions Data/2023data.json

This file was deleted.

11,302 changes: 11,302 additions & 0 deletions Data/2025data.json

Large diffs are not rendered by default.

11,302 changes: 11,302 additions & 0 deletions Data/2026data.json

Large diffs are not rendered by default.

487 changes: 0 additions & 487 deletions Data/oldData.json

This file was deleted.

35,393 changes: 21,243 additions & 14,150 deletions Data/tidesDataCombined.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions pages/api/tides.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { format } from 'date-fns';
// import data2020 from '../../Data/2020data.json';
// import data2021 from '../../Data/2021data.json';
// import data2022 from '../../Data/2022data.json';
import data2023 from '../../Data/2023data.json';
import data2024 from '../../Data/2024data.json';
import data2025 from '../../Data/2025data.json';
import data2026 from '../../Data/2026data.json';

/* ================================
Need to run *LOCALLY IN NY* :) only when to format the data
Expand All @@ -17,6 +15,11 @@ import data2024 from '../../Data/2024data.json';
================================
*/

/*
Potential to automate using this link:
https://tidesandcurrents.noaa.gov/cgi-bin/predictiondownload.cgi?&stnid=8515786&threshold=&thresholdDirection=greaterThan&bdate=2026&timezone=LST/LDT&datum=MSL&clock=24hour&type=xml&annual=true
*/

function setDateSt(dateInitial, timeInitial) {
const [year, month, day] = dateInitial.split('/').map(item => parseInt(item));
const [hour, min] = timeInitial.split(':').map(item => parseInt(item));
Expand Down Expand Up @@ -63,13 +66,10 @@ function formatData(dataYear) {
================================ */

const getDemTides = (req, res) => {
// const d2020 = formatData(data2020);
// const d2021 = formatData(data2021);
// const d2022 = formatData(data2022);
const d2023 = formatData(data2023);
const d2024 = formatData(data2024);
res.json({ data: { ...d2023, ...d2024 } });
res.json({ data: { ...d2023, ...d2024 } });
const d2025 = formatData(data2025);
const d2026 = formatData(data2026);
res.json({ data: { ...d2024, ...d2025, ...d2026 } });
};

export default getDemTides;
Expand Down

0 comments on commit 9b5b0a7

Please sign in to comment.