Skip to content

Commit

Permalink
refactor(core): add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VipulSha99 committed Jan 6, 2025
1 parent c25d2d5 commit d7b49d3
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,31 @@ export class CreateBasicIntervalStrategy
state.get('TimeInterval')
) {
const val =
state.get('value') === 1
state.get('value') == 1
? '*'
: `${state.get('toInterval').month}/${state.get('value')}`;
return `0 ${state.get('TimeInterval').min} ${
state.get('TimeInterval').hour
} ${state.get('toInterval').date} ${val} ?`;
const timeZoneDate = new Date();
timeZoneDate.setHours(state.get('TimeInterval').hour);
timeZoneDate.setMinutes(state.get('TimeInterval').min);
return `0 timeZoneDate(${timeZoneDate})timeZoneDateEnd ${
state.get('toInterval').date
} ${val} ?`;
} else if (
state.get('interval') === 'W' &&
state.get('toInterval') &&
state.get('TimeInterval')
) {
const val = state.get('value') === 1 ? '' : `/${state.get('value')}`;
const val = state.get('value') == 1 ? '' : `/${state.get('value')}`;
let weekDays = state
.get('toInterval')
?.ids?.map(
(day: string) => WeekDaysEnum[day as keyof typeof WeekDaysEnum],
)
.join(',');
return `0 ${state.get('TimeInterval').min} ${
state.get('TimeInterval').hour
} ? * ${weekDays}${val}`;
const timeZoneDate = new Date();
timeZoneDate.setHours(state.get('TimeInterval').hour);
timeZoneDate.setMinutes(state.get('TimeInterval').min);
return `0 timeZoneDate(${timeZoneDate})timeZoneDateEnd ? * ${weekDays}${val}`;
} else if (state.get('interval') === 'D' && state.get('TimeInterval')) {
const today = new Date();
today.setHours(state.get('TimeInterval').hour);
Expand Down

0 comments on commit d7b49d3

Please sign in to comment.