Add params for startDate, endDate and calculation of all recorded hours.#89
Add params for startDate, endDate and calculation of all recorded hours.#89tuomastanner wants to merge 1 commit into
Conversation
lauravuo
left a comment
There was a problem hiding this comment.
The slack integration will most likely be broken due the new params being undefined.
| logger.info(`Total working hours from range start ${totalHours}`); | ||
|
|
||
| const result = analyzer.calculateWorkedHours(range.entries); | ||
| const result = analyzer.calculateWorkedHours(range.entries, !!calcAll); |
| if (userId) { | ||
| logger.info(`Fetching data for user id ${userId}`); | ||
| const email = request.email || await slack.getUserEmailForId(userId); | ||
| const { startDate, endDate, calcAll } = request; |
There was a problem hiding this comment.
These will be always undefined since they are not parsed from command.
| logger.info(`Calculating flextime for ${email}`); | ||
| const data = await app.calcFlextime(email); | ||
| const calcFlexTime = async (email, startDate, endDate, calcAll) => { | ||
| logger.info(`Calculating flextime for ${email} ${startDate} ${endDate} ${calcAll ? 'all hours included' : ''}`); |
There was a problem hiding this comment.
calcAll? What is the purpose, !calcAll counts also hours marked on public holidays? Should you define a default value that is aligned with previous functionality?
Originally ignoring of public holidays was implemented on purpose, since a lot of people recorded hours afterwards and entered working hours also to public holidays which mixed up the billable hours calculation. So I probably wouldn't allow people marking hours on public holidays.
|
|
||
| return { | ||
| entries: sortedRangeEntries, | ||
| start: startDate || new Date(sortedRangeEntries[0].date), |
There was a problem hiding this comment.
Changed on purpose? sortedEntries -> sortedRangeEntries
| .action(generateStats); | ||
| program | ||
| .command('flextime <email>') | ||
| .command('flextime <email> [startDate] [endDate] [calcAll]') |
There was a problem hiding this comment.
Describe params in cli help text. Update README with relevant parts.
|
@tuomastanner Can we abandon this? |
No description provided.