Skip to content

Commit

Permalink
fix(ltFilesSelector): userStart/userEnd
Browse files Browse the repository at this point in the history
See #70.
  • Loading branch information
simon04 committed Feb 11, 2024
1 parent abcf236 commit 993f7ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/api/ltData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ export async function getFilesForUser(
generator: 'allimages',
gaiuser: user,
gailimit: typeof userLimit === 'number' && userLimit <= 500 ? userLimit : 'max',
gaistart: userEnd, // sic! (due to gaidir)
gaiend: userStart, // sic! (due to gaidir)
gaistart: userEnd ? new Date(userEnd).toISOString() : '', // sic! (due to gaidir)
gaiend: userStart ? new Date(userStart).toISOString() : '', // sic! (due to gaidir)
gaisort: 'timestamp',
gaidir: 'older'
};
Expand Down
12 changes: 4 additions & 8 deletions app/components/ltFilesSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,8 @@ const categoryDepth = ref(tryParse(parseInt, $route.query.categoryDepth as strin
const categorySuggestions = ref<string[]>([]);
const user = ref<string>($route.query.user as string);
const userLimit = ref(tryParse(parseInt, $route.query.userLimit as string, undefined));
const userStart = ref<Date | undefined>(
tryParse(s => new Date(s), $route.query.userStart as string, undefined)
);
const userEnd = ref<Date | undefined>(
tryParse(s => new Date(s), $route.query.userEnd as string, undefined)
);
const userStart = ref<string>($route.query.userStart as string);
const userEnd = ref<string>($route.query.userEnd as string);
const titles = ref<string>('');

function tryParse<T>(parser: (string: string) => T, text: string, fallback: T): T {
Expand Down Expand Up @@ -243,8 +239,8 @@ function nextForUser(name = 'geolocate') {
query: {
user: user.value,
userLimit: userLimit.value,
userStart: userStart.value instanceof Date ? userStart.value.toISOString() : undefined,
userEnd: userEnd.value instanceof Date ? userEnd.value.toISOString() : undefined
userStart: userStart.value,
userEnd: userEnd.value
}
});
}
Expand Down

0 comments on commit 993f7ef

Please sign in to comment.