Title: "edit_task_times" forces a 9am/5pm ScheduleStart/ScheduleFinish · Issue #4442 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: "edit_task_times" forces a 9am/5pm ScheduleStart/ScheduleFinish · Issue #4442 · IfcOpenShell/IfcOpenShell
X Title: "edit_task_times" forces a 9am/5pm ScheduleStart/ScheduleFinish · Issue #4442 · IfcOpenShell/IfcOpenShell
Description: This part of the api forces the ScheduleStart/Schedule finish to be 9am/5pm. Ideally, if the ScheduledStart is outside of a working time, it should be set to the next start time of the next applicable work time. Perhaps something along t...
Open Graph Description: This part of the api forces the ScheduleStart/Schedule finish to be 9am/5pm. Ideally, if the ScheduledStart is outside of a working time, it should be set to the next start time of the next applica...
X Description: This part of the api forces the ScheduleStart/Schedule finish to be 9am/5pm. Ideally, if the ScheduledStart is outside of a working time, it should be set to the next start time of the next applica...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/4442
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"edit_task_times\" forces a 9am/5pm ScheduleStart/ScheduleFinish","articleBody":"[This part of the api](https://github.com/IfcOpenShell/IfcOpenShell/blob/a755ec99f9a4bac3889c11bba4ad1151e6b5eee2/src/ifcopenshell-python/ifcopenshell/api/sequence/edit_task_time.py#L72C1-L91C14) forces the ScheduleStart/Schedule finish to be 9am/5pm. \r\n\r\nIdeally, if the ScheduledStart is outside of a working time, it should be set to the next start time of the next applicable work time.\r\n\r\nPerhaps something along these lines:\r\n\r\n\r\nChange get_soonest_working_day in util/sequency.py to:\r\n```python\r\ndef get_soonest_working_day(start: datetime.datetime, duration_type, calendar):\r\n if duration_type == \"ELAPSEDTIME\" or not is_calendar_applicable(start, calendar):\r\n return start\r\n while not is_working_day(start, calendar):\r\n if not is_calendar_applicable(start, calendar):\r\n break\r\n # set start to the beginning of the relevant work_time\r\n for work_time in calendar.WorkingTimes or []:\r\n if is_day_in_work_time(start, work_time):\r\n if recurrence_pattern := work_time.RecurrencePattern:\r\n if time_period := recurrence_pattern.TimePeriod:\r\n hour, minute, second = [int(part) for part in time_period.split(\":\")]\r\n start = start.replace(hour=hour, minute=minute, second=second)\r\n break\r\n return start\r\n```\r\n\r\nand then change the api:\r\n```python\r\n if start:\r\n if isinstance(start, str):\r\n start = datetime.datetime.fromisoformat(start)\r\n self.settings[\"attributes\"][\"ScheduleStart\"] = ifcopenshell.util.sequence.get_soonest_working_day(\r\n start, duration_type, self.calendar\r\n )\r\n```\r\n@myoualid your thoughts?\r\n\r\n","author":{"url":"https://github.com/vulevukusej","@type":"Person","name":"vulevukusej"},"datePublished":"2024-03-19T10:03:56Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/4442"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3cf3469b-2487-4be1-e460-4f08c5cad933 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE52:154661:2628DC:34C3E4:6B046886 |
| html-safe-nonce | 4a0b1f13ad0c051553c137c0c290831fdb61bd20da22244820c18121a2e6c7b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTUyOjE1NDY2MToyNjI4REM6MzRDM0U0OjZCMDQ2ODg2IiwidmlzaXRvcl9pZCI6Ijc0ODc1NjQ3MjExMTg1Mzc4NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0f9c2c73ed81e1b400b1806f872faaa3f41cb87124eddb5d738e5c4bf7eccdc8 |
| hovercard-subject-tag | issue:2194527865 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/4442/issue_layout |
| twitter:image | https://opengraph.githubassets.com/899db8c47840bbcb56367f1da0dd832f0be201ab89f21a09a9f8f487e986f72f/IfcOpenShell/IfcOpenShell/issues/4442 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/899db8c47840bbcb56367f1da0dd832f0be201ab89f21a09a9f8f487e986f72f/IfcOpenShell/IfcOpenShell/issues/4442 |
| og:image:alt | This part of the api forces the ScheduleStart/Schedule finish to be 9am/5pm. Ideally, if the ScheduledStart is outside of a working time, it should be set to the next start time of the next applica... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vulevukusej |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width