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 the documentation for the dateFormats and timeFormats configuration options #956

Merged
merged 20 commits into from
Sep 6, 2022

Conversation

sequba
Copy link
Contributor

@sequba sequba commented Apr 5, 2022

Context

  • make API reference for dateFormats more accurate (mention . as a valid separator)
  • make API reference for timeFormats more accurate
  • fix date-and-time-handling.md
  • cross-link between date-and-time-handling.md and API reference
  • change the implementation of the default time-parsing function to return the same value for timeFormats: ['hh:mm:ss'] and timeFormats: ['hh:mm:ss.sssss']. I consider it to be a bug-fix.
  • add more unit tests

How has this been tested?

  • all unit tests pass (including the new ones)
  • build the documentation locally and review it
  • Grammarly

Types of changes

  • Bug fix
  • Change to the documentation

Related issue(s):

Checklist:

  • My code follows the code style of this project,
  • My change requires a change to the documentation,
  • I described the modification in the CHANGELOG.md file.

@warpech
Copy link
Member

warpech commented Apr 26, 2022

@sequba is this ready for review?

@sequba sequba marked this pull request as draft April 26, 2022 10:34
@sequba
Copy link
Contributor Author

sequba commented Apr 26, 2022

@sequba is this ready for review?

No, it's not. It requires changes to the documentation.

@sequba sequba self-assigned this Aug 30, 2022
@sequba sequba changed the title Add more unit tests for dateFormats param Fix the documentation for the dateFormats and timeFormats configuration options Aug 31, 2022
@github-actions
Copy link

github-actions bot commented Sep 1, 2022

Performance comparison of head (28fde78) vs base (c43a7fe)

                                     testName |  base |  head |  change
-----------------------------------------------------------------------
                                      Sheet A | 505.1 | 508.8 |  +0.73%
                                      Sheet B |   232 | 231.5 |  -0.22%
                                      Sheet T | 276.4 | 263.5 |  -4.67%
                                Column ranges | 682.1 | 692.3 |  +1.50%
Sheet A:  change value, add/remove row/column |    43 |    33 | -23.26%
 Sheet B: change value, add/remove row/column |   318 |   315 |  -0.94%
                   Column ranges - add column |   373 |   226 | -39.41%
                Column ranges - without batch |   650 |   829 | +27.54%
                        Column ranges - batch |   142 |   142 |   0.00%

@sequba sequba marked this pull request as ready for review September 1, 2022 16:57
Comment on lines -6 to -14
`dateFormats` is a list of formats supported by the parser
inside HyperFormula. The default format is
`['MM/DD/YYYY', 'MM/DD/YY']`. The separator is ignored and it can
be any of the following: '-' (dash), ' ' (empty space),
'/' (slash).

Similar to `dateFormats`, `timeFormats` is a list of time formats
supported by the parser. The default format is
`['hh:mm', 'hh:mm:ss.sss']`. The only accepted separator is ':' (colon).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is described in the API ref for these configuration options. No need for duplication.

@sequba sequba requested a review from warpech September 1, 2022 18:46
Copy link
Member

@warpech warpech left a comment

Choose a reason for hiding this comment

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

Verified by:

  • running the docs locally
  • checking the test cases
  • comparing the PR with the issue and the Slack thread

test/interpreter/function-text.spec.ts Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
month: number,
day: number,
}
```
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a fuller example that is actually a function? This snippet is not clear.

Copy link
Contributor Author

@sequba sequba Sep 4, 2022

Choose a reason for hiding this comment

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

You commented on the removed lines. I also think this code snippet was useless. There is a full example of a custom parseDateTime function in the next section (using Moment.js). Do you think, we need another example?

Copy link
Member

@warpech warpech Sep 5, 2022

Choose a reason for hiding this comment

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

My bad, sorry.

However, the linked explanations in the docs:

are too shallow, in a way that they doesn't explain the return values.

If you could enhance that in the API reference, I think that would be enough.

Copy link
Contributor Author

@sequba sequba Sep 5, 2022

Choose a reason for hiding this comment

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

Is this ok?
image

Copy link
Member

Choose a reason for hiding this comment

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

Would be good, but the link to /api/interfaces/globals.html#datetime gives a 404 to me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that. It's fixed now.

@sequba sequba requested a review from warpech September 4, 2022 18:31
@warpech
Copy link
Member

warpech commented Sep 5, 2022

@sequba see my response to #956 (comment)

@codecov
Copy link

codecov bot commented Sep 6, 2022

Codecov Report

Merging #956 (28fde78) into develop (2805b59) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #956      +/-   ##
===========================================
+ Coverage    95.74%   95.79%   +0.05%     
===========================================
  Files          161      161              
  Lines        14098    14094       -4     
  Branches      2977     2976       -1     
===========================================
+ Hits         13498    13502       +4     
+ Misses         584      576       -8     
  Partials        16       16              
Impacted Files Coverage Δ
src/Config.ts 98.00% <ø> (ø)
src/DateTimeHelper.ts 95.65% <ø> (ø)
src/DateTimeDefault.ts 93.75% <100.00%> (-0.22%) ⬇️
src/format/format.ts 99.30% <100.00%> (+5.55%) ⬆️

@sequba sequba merged commit ae64b9f into develop Sep 6, 2022
@sequba sequba deleted the feature/issue-953 branch September 6, 2022 14:39
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.

2 participants