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

feat(formula): add some date function #2729

Merged
merged 7 commits into from
Jul 15, 2024
Merged

feat(formula): add some date function #2729

merged 7 commits into from
Jul 15, 2024

Conversation

wpxp123456
Copy link
Contributor

close #2212

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

@wpxp123456 wpxp123456 marked this pull request as ready for review July 9, 2024 08:53
Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 86.42715% with 68 lines in your changes missing coverage. Please review.

Project coverage is 26.31%. Comparing base (d47f195) to head (1015d8f).
Report is 3 commits behind head on dev.

Files Patch % Lines
...e-formula/src/functions/date/workday-intl/index.ts 82.19% 13 Missing ⚠️
...engine-formula/src/functions/date/workday/index.ts 77.58% 13 Missing ⚠️
...rmula/src/functions/date/networkdays-intl/index.ts 82.60% 12 Missing ⚠️
...ne-formula/src/functions/date/networkdays/index.ts 77.77% 12 Missing ⚠️
packages/engine-formula/src/basics/date.ts 94.50% 5 Missing ⚠️
...engine-formula/src/functions/date/weekday/index.ts 88.88% 5 Missing ⚠️
...ine-formula/src/functions/math/sumproduct/index.ts 90.19% 5 Missing ⚠️
...es/engine-formula/src/functions/date/hour/index.ts 95.00% 1 Missing ⚠️
.../engine-formula/src/functions/date/minute/index.ts 95.00% 1 Missing ⚠️
.../engine-formula/src/functions/date/second/index.ts 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2729      +/-   ##
==========================================
+ Coverage   25.98%   26.31%   +0.33%     
==========================================
  Files        1695     1704       +9     
  Lines       90709    91210     +501     
  Branches    19137    19308     +171     
==========================================
+ Hits        23569    24006     +437     
- Misses      67140    67204      +64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jul 9, 2024

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

@Dushusir Dushusir added the qa:untested This PR is ready to be tested label Jul 10, 2024
@oumomomo
Copy link

oumomomo commented Jul 12, 2024

NETWORKDAYS函数
1、E7=DAY("2012-5-23"),A3=2013/3/1,单元格内输入=NETWORKDAYS(E7,A3),计算结果跟excel不一样
image

2、H13=47,F10=99999999999,单元格内输入=NETWORKDAYS(H13,F10),结果为0未报错
image

@univer-bot
Copy link

univer-bot bot commented Jul 12, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

NETWORKDAYS function

  1. E7=DAY("2012-5-23"), A3=2013/3/1, enter =NETWORKDAYS(E7,A3) in the cell, the calculation result is different from excel
    image

  2. H13=47, F10=99999999999, enter =NETWORKDAYS(H13,F10) in the cell, the result is 0 and no error is reported
    image

@univer-bot univer-bot bot removed the qa:untested This PR is ready to be tested label Jul 12, 2024
@oumomomo
Copy link

WORKDAY函数
输入=WORKDAY(151,2008/10/1),计算结果跟excel不一致
image

@univer-bot
Copy link

univer-bot bot commented Jul 12, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

WORKDAY function
Enter =WORKDAY(151,2008/10/1), the calculation result is inconsistent with excel
image

@oumomomo
Copy link

oumomomo commented Jul 12, 2024

@DR-Univer
问题1、
SUMPRODUCT函数
单元格内输入=SUMPRODUCT(-1,2.77423423425235E+25),页面会卡死

问题2、
NETWORKDAYS.INTL函数
输入=NETWORKDAYS.INTL(DATE(2006,1,1),DATE(2006,2,1),7,{"2006/1/2","2006/1/16"})无法计算出值
image

@univer-bot
Copy link

univer-bot bot commented Jul 12, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

@DR-Univer
Question 1,
SUMPRODUCT function
Enter =SUMPRODUCT(-1,2.77423423425235E+25) in the cell, and the page will freeze.

Question 2.
NETWORKDAYS.INTL function
Input=NETWORKDAYS.INTL(DATE(2006,1,1),DATE(2006,2,1),7,{"2006/1/2","2006/1/16"}) cannot calculate the value
image

@oumomomo
Copy link

HOUR函数
输入=HOUR("-9897877"),错误码不对
image

@univer-bot
Copy link

univer-bot bot commented Jul 12, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

HOUR function
Enter =HOUR("-9897877"), the error code is incorrect
image

@oumomomo
Copy link

oumomomo commented Jul 12, 2024

MINUTE函数
1、输入=MINUTE("0")时结果为错误码,excel则为0
image

2、输入=MINUTE("59:01.01")时结果为错误码,excel为59
image

@univer-bot
Copy link

univer-bot bot commented Jul 12, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

MINUTE function

  1. When you enter =MINUTE("0"), the result is an error code, and in excel it is 0.
    image

  2. When entering =MINUTE("59:01.01"), the result is an error code, and excel is 59
    image

@oumomomo
Copy link

oumomomo commented Jul 12, 2024

SECOND函数
1、单元格内输入=SECOND("-1"),错误码问题
image
2、单元格内输入=SECOND("45:26:00"),计算报错,excel为0
image

@univer-bot
Copy link

univer-bot bot commented Jul 12, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

SECOND function

  1. Enter =SECOND("-1") in the cell, error code problem
    image
  2. Enter =SECOND("45:26:00") in the cell, the calculation will report an error, and excel will be 0
    image

@oumomomo
Copy link

WORKDAY.INTL函数
输入=WORKDAY.INTL(DATE(0,1,1),30,1)计算结果为43,Google为44,excel为41
企业微信截图_17207668985650
企业微信截图_172076694912

@univer-bot
Copy link

univer-bot bot commented Jul 12, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

WORKDAY.INTL function
Input =WORKDAY.INTL(DATE(0,1,1),30,1), the calculated result is 43, Google is 44, excel is 41
Enterprise WeChat screenshot_17207668985650
Enterprise WeChat screenshot_172076694912

@wpxp123456 wpxp123456 added the qa:untested This PR is ready to be tested label Jul 12, 2024
@univer-bot univer-bot bot removed the qa:rejected label Jul 12, 2024
@oumomomo oumomomo added qa:verified This PR has already by verified by a QA and is considered good enough to be merge and removed qa:untested This PR is ready to be tested labels Jul 15, 2024
@wpxp123456 wpxp123456 merged commit 26af2cc into dev Jul 15, 2024
9 checks passed
@wpxp123456 wpxp123456 deleted the feat/add-date-func branch July 15, 2024 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa:verified This PR has already by verified by a QA and is considered good enough to be merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Math Formula NETWORKDAYS.INTL WEEKDAY CHOOSE
3 participants