Skip to content

Commit

Permalink
feat: update start year on user's interest page
Browse files Browse the repository at this point in the history
  • Loading branch information
in-mai-space committed Jun 13, 2024
1 parent 960cc60 commit eb0cb61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frontend/mobile/src/app/(app)/user/details/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
COLLEGE,
GRADUATION_CYCLE,
MAJORS,
graduationYear
graduationYear,
startYear
} from '@/src/consts/user-info';
import { UserInfoData } from '@/src/types/userInfo';
import { convertUserData } from '@/src/utils/userInfo';
Expand Down Expand Up @@ -181,7 +182,7 @@ const UserDetails = () => {
onChange={onChange}
placeholder="Select start year"
title="Start Year"
data={graduationYear()}
data={startYear()}
/>
)}
name="startYear"
Expand Down
14 changes: 13 additions & 1 deletion frontend/mobile/src/consts/user-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const GRADUATION_CYCLE: Item[] = [

export const graduationYear = () => {
var year = new Date().getFullYear();
const range = 5;
const range = 6;
const graduationYears: Item[] = [];
for (let i = 0; i < range; i++) {
graduationYears.push({
Expand All @@ -30,6 +30,18 @@ export const graduationYear = () => {
return graduationYears;
};

export const startYear = () => {
var year = new Date().getFullYear();
const graduationYears: Item[] = [];
for (let i = 5; i >= 0; i--) {
graduationYears.push({
key: String(year - i),
value: String(year - i)
});
}
return graduationYears;
}

Check failure on line 43 in frontend/mobile/src/consts/user-info.ts

View workflow job for this annotation

GitHub Actions / Lint

Insert `;`

export const MAJORS: Item[] = [
{ key: 'africanaStudies', value: 'Africana Studies' },
{ key: 'americanSignLanguage', value: 'American Sign Language' },
Expand Down

0 comments on commit eb0cb61

Please sign in to comment.