fix: include tests in utils

pull/100/head
Pierre-Louis Guhur 1 year ago
parent 407a67dd06
commit d9198e0490

@ -45,7 +45,7 @@ export async function getServerSideProps({query: {pid, tid}, locale}) {
return {notFound: true};
}
if (election.date_end && isEnded(election.date_end)) {
if (isEnded(election.date_end)) {
const url = getUrl(RouteTypes.ENDED_VOTE, locale, electionRef)
return {
redirect: {

@ -31,7 +31,7 @@ export const displayRef = (ref: string): string => {
};
export const isEnded = (date: string): boolean => {
console.log("IS ENDED", date)
if (!date) return false;
const dateEnd = new Date(date);
const now = new Date();
return +dateEnd < +now;

Loading…
Cancel
Save