Skip to content

Commit aa1a5ec

Browse files
committed
refactor: drop the today override from ILR_DATA
The data file could pin the app's idea of today to a fixed date for reproducing a view, but this feature is unused. Remove the override so the real current date is always used.
1 parent 0e3abd3 commit aa1a5ec

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/app.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ interface ILRData {
2121
limit?: number;
2222
visaValidFrom?: string;
2323
firstArrivalOn?: string;
24-
today?: string | null;
2524
trips?: RawTrip[];
2625
}
2726

@@ -128,7 +127,7 @@ interface Domain {
128127
let trips: Trip[] = [];
129128
let visaValidFrom = "";
130129
let firstArrivalOn = "";
131-
const TODAY = D.today ? toDay(D.today) : Math.floor(Date.now() / DAY);
130+
const TODAY = Math.floor(Date.now() / DAY);
132131

133132
function loadFromFile(): void {
134133
visaValidFrom = D.visaValidFrom || "";
@@ -705,7 +704,7 @@ interface Domain {
705704
` limit: ${LIMIT},\n` +
706705
` visaValidFrom: "${visaValidFrom}",\n` +
707706
` firstArrivalOn: "${firstArrivalOn}",\n` +
708-
" today: null,\n\n trips: [\n" + body + "\n ],\n};\n";
707+
"\n trips: [\n" + body + "\n ],\n};\n";
709708
navigator.clipboard.writeText(txt).then(
710709
() => flash("copied — paste into trips.js"),
711710
() => { flash("copy blocked; see the console"); console.log(txt); }

trips.js.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ window.ILR_DATA = {
1313
limit: 180, // days absent allowed in any rolling 12 months
1414
visaValidFrom: "2024-01-01",
1515
firstArrivalOn: "2024-01-20",
16-
today: null, // null = use the real current date
1716

1817
trips: [
1918
{

0 commit comments

Comments
 (0)