Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use get_datetime_as_string with correct time format #43930

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lbrandh
Copy link
Contributor

@lbrandh lbrandh commented Oct 30, 2024

Timesheet and Timer use a mixture of d.format(frappe.defaultDatetimeFormat) and frappe.datetime.get_datetime_as_string().
Both until now do not respect the time format set in sysdefaults.
This can cause rounding errors when client side scripts calculate based upon unsubmitted values.
When sysdefaults TimeFormat is selected to be "HH:mm" and in a Timesheet a to_time or from_time with seconds is submitted, the hours field is calculated with seconds included. After submission the seconds are stripped from to_time or from_time, creating a missmatch of hours calculated and to_time - from_time.

This patch depends on fix: get_datetime_as_string should respect time_format in frappe and solves the rounding/missmatch problem, as well as cleans up the scripts to only use get_datetime_as_string.

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.

1 participant