14 lines
276 B
TypeScript
14 lines
276 B
TypeScript
|
import { ReleaseData } from '../types';
|
||
|
|
||
|
export const compareReleasesFn = (a: ReleaseData, b: ReleaseData) => {
|
||
|
if (new Date(a.published) > new Date(b.published)) {
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
if (new Date(a.published) < new Date(b.published)) {
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
};
|