Skip to content

Commit

Permalink
Show snarest and not 'ikke spesifisert'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikskog committed Oct 5, 2024
1 parent b7fdaab commit 8f08226
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/career/components/JobDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import ApplyButton from './ApplyButton';

/**
* @summary formats the deadline from ISO format to Date Month Year
* @return the formated deadline as a string or the string "Ikke spesifisert" if deadline is null
* @return the formated deadline as a string or the string "Snarest" if deadline is null
*/
export const formatDeadline = (deadline: string): string => {
export const formatDeadline = (deadline?: string): string => {
if (deadline) {
return DateTime.fromISO(deadline).toFormat('d MMM y');
}
return 'Ikke spesifisert';
return 'Snarest';
};

interface IProps {
Expand Down Expand Up @@ -71,7 +71,7 @@ const JobDetails: FC<IProps> = ({ opportunity }) => (
<h3>Nøkkelinformasjon</h3>
<p>Type: {opportunity.employment.name}</p>
<p>Sted: {formatLocations(opportunity.location.map((loc) => loc.name))}</p>
<p>Frist: {opportunity.deadline ? formatDeadline(opportunity.deadline) : 'snarest'}</p>
<p>Frist: {formatDeadline(opportunity.deadline)}</p>
{opportunity.rolling_admission && (
<p>
<strong>Søknader vurderes fortløpende</strong>
Expand Down

0 comments on commit 8f08226

Please sign in to comment.