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

timeutil: preserve field/type information when parsing ISODuration #3272

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

mastercactapus
Copy link
Member

Description:
This PR updates the timeutil.ISODuration to preserve information about weeks, hours, minutes, and seconds.

Convenience methods were added for code that previously relied on the combined field values:

  • The struct now has explicit fields for each part (e.g., .YearPart and .WeekPart)
  • A .TimePart() method was added to convert hours/minutes/seconds into a time.Duration
  • A .SetTimePart(time.Duration) method was added to do the reverse
  • A .Days() method was added to give .WeekPart and .DayPart together

This allows the backend to use this type information and is necessary work for #3243

Copy link
Contributor

@allending313 allending313 left a comment

Choose a reason for hiding this comment

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

lgtm!

@allending313 allending313 merged commit b4d99ce into master Sep 11, 2023
@allending313 allending313 deleted the isoduration-preserve-fields branch September 11, 2023 19:54
allending313 added a commit that referenced this pull request Sep 13, 2023
* add monthly rotation feat

* update db-schema

* revert migration update, create new migration

* update models.go

* update monthly start/end to be datetime-from-start-of-month

* update monthly rotation logic

* make db-schema && make generate

* fix ts error

* add monthly rotation smoke test

* fix rotation tests

* refactor smoke test

* refactor shiftLengthHours to shiftLength

* fix webhook expansion when slack is disabled (#3264)

* dev: add local db url to dev setup guide (#3266)

* add local db url to dev setup guide

* clarify no pass

* Bump react-redux from 8.1.1 to 8.1.2 (#3269)

Bumps [react-redux](https://github.com/reduxjs/react-redux) from 8.1.1 to 8.1.2.
- [Release notes](https://github.com/reduxjs/react-redux/releases)
- [Changelog](https://github.com/reduxjs/react-redux/blob/master/CHANGELOG.md)
- [Commits](reduxjs/react-redux@v8.1.1...v8.1.2)

---
updated-dependencies:
- dependency-name: react-redux
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump eslint-plugin-import from 2.27.5 to 2.28.1 (#3268)

Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.27.5 to 2.28.1.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.27.5...v2.28.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/checkout from 3 to 4 (#3267)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* preserve field/type information when parsing ISODuration (#3272)

* add monthly rotation feat

* update db-schema

* revert migration update, create new migration

* update monthly rotation logic

* make db-schema && make generate

* refactor monthly rotation api

* fix rotation test

* move new migration to the end

* cleanup CalcRotationHandoffTimes and fix missing Start

* add missing validation and fix error

* fix deprecation warning

* polish

* revert whitespace change (will fail on CI otherwise)

* fix schema.sql out of date

* add comments to new rotation logic

* minor fixes for clarity

* revert timeFormat test corrections

* fix page crash if rotation is monthly

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: AllenDing <[email protected]>
Co-authored-by: Nathaniel Caza <[email protected]>
Co-authored-by: Nathaniel Cook <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants