docs: missing documentation for TO_PREVIOUS_* datetime navigation functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- sql
- Domain
- documentation
Research direction
Start by reading src/query/functions/src/scalars/timestamp/src/datetime.rs, especially the rounder_functions_helper registration in register_rounder_functions, and compare the existing grouped datetime-function documentation. Add a page under docs/en/sql-reference/20-sql-functions/05-datetime-functions/ covering all seven TO_PREVIOUS_* functions, their DATE or TIMESTAMP inputs, outputs, examples, and distinction from PREVIOUS_DAY.
Written by the indexing model from the issue text.
Description
Missing Documentation
The TO_PREVIOUS_* family of datetime navigation functions is implemented in Databend but has no documentation in the SQL reference.
Source Code
File: /workspace/databend/src/query/functions/src/scalars/timestamp/src/datetime.rs
Registered via rounder_functions_helper in register_rounder_functions:
to_previous_mondayto_previous_tuesdayto_previous_wednesdayto_previous_thursdayto_previous_fridayto_previous_saturdayto_previous_sunday
What They Do
Each function takes a DATE or TIMESTAMP value and returns the date of the most recent occurrence of the specified day of the week before the input date. For example, TO_PREVIOUS_MONDAY('2024-04-20') returns the date of the Monday before April 20, 2024.
These are distinct from PREVIOUS_DAY(date, 'monday') — they are fixed-day convenience functions with no second argument.
Suggested Doc Location
/docs/en/sql-reference/20-sql-functions/05-datetime-functions/
A single page covering all 7 functions (similar to how TO_START_OF_* functions are grouped) would work well, e.g. to-previous-day-of-week.md.
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 44
- Avg merge
- 2d 7m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databendlabs/databend-docs
-
Link Checker Report Openautomated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
databendlabs/databend-docs#3504 ·
-
Link Checker Report Openautomated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databendlabs/databend-docs#3503 ·
-
auto-fix-done documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
databendlabs/databend-docs#3359 ·
-
auto-fix-done documentation
Difficulty 2/5 1-2 days Newbie friendliness 72/100
databendlabs/databend-docs#3356 ·
-
auto-fix documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
databendlabs/databend-docs#3302 ·
All issues in databendlabs/databend-docs
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100