Skip to content

Commit

Permalink
refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
PondiB committed Sep 25, 2023
1 parent fab0d95 commit 5d5a50f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- New processes in proposal state:
- `date_difference`
- `date_get_component`
- `date_replace`
- `date_replace_component`
- `filter_vector`
- `flatten_dimensions`
- `load_geojson`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "date_replace",
"id": "date_replace_component",
"summary": "Replaces a part of a date",
"description": "Replaces a part of a given date string with a new value based on the provided component, allowing for easy replacing of dates.\n\n In case a date/time overflow, the component will be clipped to their respective bounds e.g. if hour is set to 27, it can be clipped to 23. Similarly, if day is set to -40, it can be clipped to the first day of the month",
"categories": [
Expand All @@ -23,13 +23,6 @@
}
]
},
{
"name": "value",
"description": "The period of time in the component given to replace the existing value.",
"schema": {
"type": "integer"
}
},
{
"name": "component",
"description": "The component for the value given. The following pre-defined components are available:\n\n- millisecond: Milliseconds\n- second: Seconds .\n- minute: Minutes\n- hour: Hours\n- day: Days - changes only the the day part of a date\n- month: Months\n- year: Years\n\nReplacements with the component `year`, `month` or `day` do never change the time.",
Expand All @@ -45,6 +38,13 @@
"year"
]
}
},
{
"name": "value",
"description": "The period of time in the component given to replace the existing value.",
"schema": {
"type": "integer"
}
}
],
"returns": {
Expand All @@ -66,41 +66,41 @@
{
"arguments": {
"date": "2020-02-01T17:22:45Z",
"value": 6,
"component": "month"
"component": "month",
"value": 6
},
"returns": "2020-06-01T17:22:45Z"
},
{
"arguments": {
"date": "2021-03-31T00:00:00+02:00",
"value": 7,
"component": "day"
"component": "day",
"value": 7
},
"returns": "2021-03-07T00:00:00+02:00"
},
{
"arguments": {
"date": "2018-01-01",
"value": 2023,
"component": "year"
"component": "year",
"value": 2023
},
"returns": "2023-01-01"
},
{
"arguments": {
"date": "2018-01-01",
"value": 5,
"component": "month"
"component": "month",
"value": 5
},
"returns": "2017-05-01"
},
{
"description": "A date overflow is clipped to the respective bound of the date component.",
"arguments": {
"date": "2023-01-30",
"value": -40,
"component": "day"
"component": "day",
"value": -40
},
"returns": "2023-01-01"
}
Expand Down

0 comments on commit 5d5a50f

Please sign in to comment.