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

[PORT] Add getNextViableDate, getPreviousViableDate, getNextViableTime, getPreviousViableTime pre-built functions #2601

Merged
merged 30 commits into from
Aug 7, 2020

Conversation

cosmicshuai
Copy link
Contributor

fixes: #2559

Assume today is 2020-06-12 and current time is 15:42:21
getNextViableDate:
description: given a timex property of a valid month and day of month, evaluate the next viable date based on the current time at certain timezone
The signature is getNextViableDate(timex: string, timezone? : string) -> result:string
getNextViableDate("XXXX-12-20", "America/Los_Angelas") -> "2020-12-20"
getNextViableDate("XXXX-02-29") -> "2024-02-29"

getPreviousViableDate:
description: given a timex property of a valid month and day of month, evaluate the previous viable date based on the current time at certain timezone
The signature is getPreviousViableDate(timex: string, timezone? : string) -> result:string
getPreviousViableDate("XXXX-12-20", "Eastern Standard Time") -> "2019-12-20"
getPreviousViableDate("XXXX-02-29") -> "2020-02-29"

getNextViableTime:
description: given a timex property of a valid minutes and seconds, evaluate the next viable time based on the current time at certain timezone
The signature is getNextViableTime(timex: string, timezone? : string) -> result:string
getNextViableTime("TXX:12:14", "Asia/Tokyo") -> "T16:12:14"
getNextViableTime("TXX:52:14) -> "T15:52:14"

getPreviousViableTime:
description: given a timex property of a valid minutes and seconds, evaluate the previous viable time based on the current time at certain timezone
The signature is getPreviousViableTime(timex: string, timezone? : string) -> result:string
getPreviousViableTime("TXX:12:14", 'Europe/London') -> "T15:12:14"
getPreviousViableTime("TXX:52:14") -> "T14:52:14"

@cosmicshuai cosmicshuai requested a review from a team as a code owner July 28, 2020 17:09
@cosmicshuai cosmicshuai requested a review from luhan2017 July 28, 2020 17:09
@coveralls
Copy link

coveralls commented Jul 28, 2020

Pull Request Test Coverage Report for Build 154944

  • 169 of 176 (96.02%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 82.946%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/adaptive-expressions/src/builtinFunctions/getNextViableTime.ts 39 40 97.5%
libraries/adaptive-expressions/src/builtinFunctions/getPreviousViableTime.ts 39 40 97.5%
libraries/adaptive-expressions/src/builtinFunctions/getNextViableDate.ts 41 43 95.35%
libraries/adaptive-expressions/src/builtinFunctions/getPreviousViableDate.ts 40 43 93.02%
Totals Coverage Status
Change from base Build 154890: 0.09%
Covered Lines: 14997
Relevant Lines: 17187

💛 - Coveralls

@cosmicshuai cosmicshuai changed the title Shuwan/timex date func [PORT] Add getNextViableDate, getPreviousViableDate, getNextViableTime, getPreviousViableTime pre-built functions Jul 29, 2020
@stevengum stevengum added Adaptive R10 Release 10 - August 17th, 2020 labels Jul 30, 2020
Copy link
Contributor

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

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

🕐

Copy link
Contributor

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

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

:shipit:

@chrimc62
Copy link
Contributor

chrimc62 commented Aug 6, 2020

Fix the two remaining any -> Expression and you are good to go.

@cosmicshuai cosmicshuai merged commit 87c0be3 into master Aug 7, 2020
@cosmicshuai cosmicshuai deleted the shuwan/timexDateFunc branch August 7, 2020 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R10 Release 10 - August 17th, 2020
Projects
None yet
5 participants