Skip to content

Add --begin/--end and --timezone to start - #36

Open
parthitce wants to merge 1 commit into
kimai:masterfrom
linumiz:dev/add-begin-end-tz
Open

parthitce wants to merge 1 commit into
kimai:masterfrom
linumiz:dev/add-begin-end-tz

Conversation

@parthitce

Copy link
Copy Markdown

Allow creating timesheet records with explicit begin/end times, and a -z/--timezone to name the IANA zone used to read them (falls back to the PHP default). Invalid zone fails cleanly without entering the refine prompt.

Co-authored-by: webemerge office@web-emerge.com
Signed-off-by: webemerge office@web-emerge.com
Signed-off-by: Parthiban Nallathambi parthiban@linumiz.com

Comment thread src/Command/TimesheetCommandTrait.php Outdated
Comment on lines +337 to +342
return $this->parseAndRefineDateTime(
$io,
$io->ask(\sprintf('Value "%s" for field "%s" is not a valid DateTime. Please refine:', $value, $valueName), $value),
$valueName,
$timezone,
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was in the original PR, but I would propose to use something like this instead (untested code!)

$io->error((\sprintf('Value "%s" for field "%s" is not a valid DateTime.', $value, $valueName));
return Command::ERROR;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed and tested. Thanks for the review.

Allow creating timesheet records with explicit begin/end times, and a
-z/--timezone to name the IANA zone used to read them (falls back to the
PHP default). Invalid zone fails cleanly without entering the refine prompt.

Co-authored-by: webemerge <office@web-emerge.com>
Signed-off-by: webemerge <office@web-emerge.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants