File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/common/helper/services Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -220,23 +220,18 @@ export class HelperDateService implements IHelperDateService {
220220 options ?: IHelperDateStartAndEnd
221221 ) : IHelperDateStartAndEndDate {
222222 const today = moment ( ) ;
223- const todayMonth = Number (
224- today . format ( ENUM_HELPER_DATE_FORMAT . ONLY_MONTH )
225- ) ;
226- const todayYear = Number (
227- today . format ( ENUM_HELPER_DATE_FORMAT . ONLY_YEAR )
228- ) ;
229-
223+ const todayMonth = today . format ( ENUM_HELPER_DATE_FORMAT . ONLY_MONTH ) ;
224+ const todayYear = today . format ( ENUM_HELPER_DATE_FORMAT . ONLY_YEAR ) ;
230225 // set month and year
231226 const year = options ?. year ?? todayYear ;
232227 const month = options ?. month ?? todayMonth ;
233228
234- const date = moment ( `${ year } -${ month } -02` ) ;
229+ const date = moment ( `${ year } -${ month } -02` , 'YYYY-MM-DD' ) ;
235230 let startDate : Date = date . startOf ( 'year' ) . toDate ( ) ;
236231 let endDate : Date = date . endOf ( 'year' ) . toDate ( ) ;
237232
238233 if ( options ?. month ) {
239- const date = moment ( `${ year } -${ month } -02` ) ;
234+ const date = moment ( `${ year } -${ month } -02` , 'YYYY-MM-DD' ) ;
240235 startDate = date . startOf ( 'month' ) . toDate ( ) ;
241236 endDate = date . endOf ( 'month' ) . toDate ( ) ;
242237 }
You can’t perform that action at this time.
0 commit comments