File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,10 @@ const service = {
2828 const year = date . getFullYear ( ) % 10
2929 const groupYear = Number ( group . slice ( - 2 , - 1 ) )
3030 const currSemester = await univerService . getCurrSemester ( )
31+ const isNextYearWithPrevSemester = date . getMonth ( ) === 0
3132 const course = currSemester === 2
3233 ? year - groupYear
33- : year - groupYear + 1
34+ : year - groupYear + ( isNextYearWithPrevSemester ? 0 : 1 )
3435 if ( course < 0 || course > 4 ) {
3536 return this . getCourseByOther ( group )
3637 }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ describe('group service', () => {
3232 describe ( 'workable group' , ( ) => {
3333 it ( 'should return valid course' , async ( ) => {
3434 const groupName = 'kv-51'
35- const expectedCourse = 3
35+ const expectedCourse = 4
3636 const course = await service . getCourse ( groupName )
3737 assert . equal ( course , expectedCourse )
3838 } )
You can’t perform that action at this time.
0 commit comments