From 5d5a50f893da622f20edb73487071742a5dd4ca6 Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Mon, 25 Sep 2023 15:25:13 +0200 Subject: [PATCH] refactored --- CHANGELOG.md | 2 +- ...place.json => date_replace_component.json} | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) rename proposals/{date_replace.json => date_replace_component.json} (91%) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa843d0e..d1a2f110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/proposals/date_replace.json b/proposals/date_replace_component.json similarity index 91% rename from proposals/date_replace.json rename to proposals/date_replace_component.json index 8861ba8a..8bb5f4e7 100644 --- a/proposals/date_replace.json +++ b/proposals/date_replace_component.json @@ -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": [ @@ -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.", @@ -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": { @@ -66,32 +66,32 @@ { "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" }, @@ -99,8 +99,8 @@ "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" }