From c83d4dcddc22dd9d64f33ea1dca58630aae45392 Mon Sep 17 00:00:00 2001 From: Dharcf Date: Mon, 30 Dec 2024 22:18:32 +0530 Subject: [PATCH] Added the new functions for setDay,setYear,setHour,setMinute,setSecond,setMonth. --- data/en/setday.json | 38 ++++++++++++++++++++++++++++++++++++++ data/en/sethour.json | 34 ++++++++++++++++++++++++++++++++++ data/en/setminute.json | 34 ++++++++++++++++++++++++++++++++++ data/en/setmonth.json | 34 ++++++++++++++++++++++++++++++++++ data/en/setsecond.json | 34 ++++++++++++++++++++++++++++++++++ data/en/setyear.json | 34 ++++++++++++++++++++++++++++++++++ 6 files changed, 208 insertions(+) create mode 100644 data/en/setday.json create mode 100644 data/en/sethour.json create mode 100644 data/en/setminute.json create mode 100644 data/en/setmonth.json create mode 100644 data/en/setsecond.json create mode 100644 data/en/setyear.json diff --git a/data/en/setday.json b/data/en/setday.json new file mode 100644 index 000000000..5f2a1a6d9 --- /dev/null +++ b/data/en/setday.json @@ -0,0 +1,38 @@ +{ + "name": "setDay", + "type": "function", + "syntax": "date.setDay(number)", + "returns": "date", + "related": ["SetMonth","SetYear","SetHour","SetMinute","SetSecond"], + "description": "Sets the day for the Date object.", + "params": [ + { + "name":"number", + "description":"The number of datepart units to add to the provided date.\n Number must be an integer.\n Negative integers move the date into the past, positive into the future.", + "required":true, + "default":"", + "type":"numeric", + "values":[] + }, + { + "name":"date", + "description":"A datetime object in the range of 100AD-9999AD.\n\r NOTE: When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.", + "required":true, + "default":"", + "type":"date", + "values":[] + } + ], + "engines": { + "coldfusion": {"minimum_version":"", "notes":"Member function is available in CF18+.", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-s/setday.html"} + }, + "examples":[ + {"title":"Set Day to a Date", "description":"Sets the day on the Date object.", "code":"\n#myday.setday(15)#"}, + {"title":"Set Day to a Date", "description":"Sets the day on the Date object.", "code":"\n#myday.setday(15)#","result":"{ts '2024-01-15 00:00:00'}"} + ], + "links": [] +} + + + + diff --git a/data/en/sethour.json b/data/en/sethour.json new file mode 100644 index 000000000..c57ff3555 --- /dev/null +++ b/data/en/sethour.json @@ -0,0 +1,34 @@ +{ + "name":"setHour", + "type":"function", + "syntax":"date.SetHour(number)", + "return":"date", + "related":["setDay","SetMonth","SetYear","SetMinute","SetSecond"], + "description":"Sets the hour on the Date object.", + "params":[ + { + "name":"number", + "description":"Number representing the hour.\n\r Number must be an integer.\r\n\nExpected values are 0-23, but other values are allowed:\r\n* -1 results in the last hour of the previous day.\r\n * 24 results in the first hour of the next day", + "required":true, + "default":"", + "type":"numeric", + "values":[] + }, + { + "name":"date", + "description":"A datetime object in the range of 100AD-9999AD.\n\r NOTE: When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.", + "required":true, + "default":"", + "type":"date", + "values":[] + } + ], + "engines": { + "coldfusion": {"minimum_version":"", "notes":"Member function is available in CF18+.", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-s/sethour.html"} + }, + "examples":[ + {"title":"Set Hour to an Date", "description":"", "code":"\n#myhour.setHour(-1)#"}, + {"title":"Set Hour as 1 to an Date", "description":"", "code":"\n#myhour.setHour(1)#", "result":"{ts '2024-12-23 01:00:00'}"} + ], + "links": [] +} \ No newline at end of file diff --git a/data/en/setminute.json b/data/en/setminute.json new file mode 100644 index 000000000..27d29331c --- /dev/null +++ b/data/en/setminute.json @@ -0,0 +1,34 @@ +{ + "name":"SetMinute", + "type":"function", + "syntax":"date.SetMinute(number)", + "return":"date", + "related":["setDay","SetMonth","SetYear","SetHour","SetSecond"], + "description":"Sets the minute on the Date object..", + "params":[ + { + "name":"number", + "description":"Number representing the minutes.\n\r Number must be an integer.\r\n\nExpected values are 0-59, but other values are allowed:\r\n* -1 results in the last second of the previous minute.\n\r* 60 results in the first second of the next minute.", + "required":true, + "default":"", + "type":"numeric", + "values":[] + }, + { + "name":"date", + "description":"A datetime object in the range of 100AD-9999AD.\n\r NOTE: When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.", + "required":true, + "default":"", + "type":"date", + "values":[] + } + ], + "engines": { + "coldfusion": {"minimum_version":"", "notes":"Member function is available in CF18+.", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-s/set-minute.html"} + }, + "examples":[ + {"title":"Set Minute to an Date", "description":"Sets the Minute on the Date object.", "code":"\n#minute.setMinute(-1)#"}, + {"title":"Set Minute to an Date", "description":"Sets the Minute as 30 on the Date object.", "code":"\n#minute.setMinute(30)#", "result":"{ts '2023-08-15 00:30:00'}"} + ], + "links": [] +} \ No newline at end of file diff --git a/data/en/setmonth.json b/data/en/setmonth.json new file mode 100644 index 000000000..c639fd5b8 --- /dev/null +++ b/data/en/setmonth.json @@ -0,0 +1,34 @@ +{ + "name":"SetMonth", + "type":"function", + "syntax":"date.SetMonth(number)", + "return":"date", + "related":["setDay","SetMinute","SetYear","SetHour","SetSecond"], + "description":"Sets the month on the Date object..", + "params":[ + { + "name":"number", + "description":"Number representing the months.\n\r Number must be an integer.\r\n\n Number range should be 1 to 12.", + "required":true, + "default":"", + "type":"numeric", + "values":[] + }, + { + "name":"date", + "description":"A datetime object in the range of 100AD-9999AD.\n\r NOTE: When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.", + "required":true, + "default":"", + "type":"date", + "values":[] + } + ], + "engines": { + "coldfusion": {"minimum_version":"", "notes":"Member function is available in CF18+.", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-s/setmonth.html"} + }, + "examples":[ + {"title":"Set Month to an Date", "description":"Sets the Month on the Date object.", "code":"\n#mymonth.setMonth(10)#"}, + {"title":"Sets the Month as 3 on the Date object", "description":"", "code":"\n#mymonth.setMonth(3)#", "result":"{ts '2024-03-08 00:00:00'}"} + ], + "links": [] +} \ No newline at end of file diff --git a/data/en/setsecond.json b/data/en/setsecond.json new file mode 100644 index 000000000..a0bbb1eb7 --- /dev/null +++ b/data/en/setsecond.json @@ -0,0 +1,34 @@ +{ + "name":"SetSecond", + "type":"function", + "syntax":"date.SetSecond(number)", + "return":"date", + "related":["setDay","SetMonth","SetMinute","SetHour","SetYear"], + "description":"Sets the Second on the Date object..", + "params":[ + { + "name":"number", + "description":"Number representing the year.\n\r Number must be an integer.\r\n\nExpected values are 0-59, but other values are allowed:\r\n* -1 results in the last second of the previous minute.\n\r* 60 results in the first second of the next minute", + "required":true, + "default":"", + "type":"numeric", + "values":[] + }, + { + "name":"date", + "description":"A datetime object in the range of 100AD-9999AD.\n\r NOTE: When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.", + "required":true, + "default":"", + "type":"date", + "values":[] + } + ], + "engines": { + "coldfusion": {"minimum_version":"", "notes":"Member function is available in CF18+.", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-s/set-second.html"} + }, + "examples":[ + {"title":"Set Minute to an Date", "description":"Sets the Minute on the Date object.", "code":"\n#day.Setsecond(56)#"}, + {"title":"Set Year to an Date", "description":"Sets the Year as 2022 on the Date object.", "code":"\n#day.Setsecond(10)#", "result":"{ts '2022-11-24 00:00:10'}"} + ], + "links": [] +} \ No newline at end of file diff --git a/data/en/setyear.json b/data/en/setyear.json new file mode 100644 index 000000000..a6d3bc803 --- /dev/null +++ b/data/en/setyear.json @@ -0,0 +1,34 @@ +{ + "name":"SetYear", + "type":"function", + "syntax":"date.SetYear(number)", + "return":"date", + "related":["setDay","SetMonth","SetMinute","SetHour","SetSecond"], + "description":"Sets the Year on the Date object..", + "params":[ + { + "name":"number", + "description":"Number representing the year.\n\r Number must be an integer.", + "required":true, + "default":"", + "type":"numeric", + "values":[] + }, + { + "name":"date", + "description":"A datetime object in the range of 100AD-9999AD.\n\r NOTE: When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.", + "required":true, + "default":"", + "type":"date", + "values":[] + } + ], + "engines": { + "coldfusion": {"minimum_version":"", "notes":"Member function is available in CF18+.", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-s/setyear.html"} + }, + "examples":[ + {"title":"Set Minute to an Date", "description":"Sets the Minute on the Date object.", "code":"\n#myyear.setYear(2020)#"}, + {"title":"Set Year to an Date", "description":"Sets the Year as 2022 on the Date object.", "code":"\n#myyear.setYear(2022)#", "result":"{ts '2022-11-24 00:00:00'}"} + ], + "links": [] +} \ No newline at end of file