Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppUms_Lecturer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tungnq
AppUms_Lecturer
Commits
475e212d
Commit
475e212d
authored
Aug 25, 2025
by
tungnq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: Thực hiện refactor code lần 1
parent
dd76d0fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
index.js
src/screens/class_schedule/index.js
+1
-0
view.js
src/screens/class_schedule/view.js
+3
-8
No files found.
src/screens/class_schedule/index.js
View file @
475e212d
...
...
@@ -300,6 +300,7 @@ const ClassSchedule = ({events = [], onDateSelect, onEventPress}) => {
getEventsForDate
=
{
getEventsForDate
}
parseLocalDate
=
{
parseLocalDate
}
formatDateToDisplay
=
{
formatDateToDisplay
}
formatDateToString
=
{
formatDateToString
}
isCurrentMonth
=
{
isCurrentMonth
}
isToday
=
{
isToday
}
navigateMonth
=
{
navigateMonth
}
...
...
src/screens/class_schedule/view.js
View file @
475e212d
...
...
@@ -25,6 +25,7 @@ const ClassScheduleView = ({
getEventsForDate
,
parseLocalDate
,
formatDateToDisplay
,
formatDateToString
,
isCurrentMonth
,
isToday
,
navigateMonth
,
...
...
@@ -75,7 +76,7 @@ const ClassScheduleView = ({
);
};
const
renderDayCell
=
(
date
,
index
)
=>
{
const
renderDayCell
=
(
date
,
index
,
formatDateToString
)
=>
{
const
dayEvents
=
getEventsForDate
(
date
);
const
isSelected
=
selectedDate
===
formatDateToString
(
date
);
const
isTodayDate
=
isToday
(
date
);
...
...
@@ -126,12 +127,6 @@ const ClassScheduleView = ({
);
};
const
formatDateToString
=
(
date
)
=>
{
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
};
const
renderCalendarGrid
=
()
=>
{
...
...
@@ -141,7 +136,7 @@ const ClassScheduleView = ({
weeks
.
push
(
<
View
key
=
{
i
}
style
=
{
styles
.
weekRow
}
>
{
week
.
map
((
date
,
dayIndex
)
=>
renderDayCell
(
date
,
i
*
7
+
dayIndex
),
renderDayCell
(
date
,
i
*
7
+
dayIndex
,
formatDateToString
),
)}
<
/View>
,
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment