mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
- `curly` requires conditionals to use curly braces - `react/jsx-curly-brace-presence` requires string props to *not* have curly braces
17 lines
312 B
TypeScript
17 lines
312 B
TypeScript
/**
|
|
* Comparator function for sorting dates in ascending order
|
|
*/
|
|
export const dateComparator = (a: string, b: string) => {
|
|
const dateA = new Date(a);
|
|
const dateB = new Date(b);
|
|
|
|
// sort in ascending order
|
|
if (dateA > dateB) {
|
|
return 1;
|
|
}
|
|
if (dateA < dateB) {
|
|
return -1;
|
|
}
|
|
return 0;
|
|
};
|