From 9d999bd6ddb5397c13451545f895306ec7373412 Mon Sep 17 00:00:00 2001 From: KamasamaK Date: Tue, 2 Apr 2024 08:55:09 -0400 Subject: [PATCH] Added CF support for millisecond --- data/en/cf2021.json | 2 +- data/en/millisecond.json | 3 +- guides/en/member.md | 101 +++++++++++++++++++++------------------ 3 files changed, 57 insertions(+), 49 deletions(-) diff --git a/data/en/cf2021.json b/data/en/cf2021.json index 23e43f6cf..24e6fae8a 100644 --- a/data/en/cf2021.json +++ b/data/en/cf2021.json @@ -1,4 +1,4 @@ { - "related":["arrayPop","arrayPush","arrayReduceRight","arrayShift","arrayUnshift","cfjava","clearTimeZone","generateBCryptHash","generateSCryptHash","getTimeZone","listReduceRight","setTimeZone","stringEach","stringEvery","stringFilter","stringMap","stringReduce","stringReduceRight","stringSome","stringSort","structIsCaseSensitive","verifyBCryptHash","verifySCryptHash"], + "related":["arrayPop","arrayPush","arrayReduceRight","arrayShift","arrayUnshift","cfjava","clearTimeZone","generateBCryptHash","generateSCryptHash","getTimeZone","listReduceRight","millisecond","setTimeZone","stringEach","stringEvery","stringFilter","stringMap","stringReduce","stringReduceRight","stringSome","stringSort","structIsCaseSensitive","verifyBCryptHash","verifySCryptHash"], "name":"ColdFusion 2021 New Functions and Tags","type":"listing","description":"List of tags and functions added in ColdFusion 2021" } \ No newline at end of file diff --git a/data/en/millisecond.json b/data/en/millisecond.json index 1db99f6b3..8af718b9b 100644 --- a/data/en/millisecond.json +++ b/data/en/millisecond.json @@ -7,10 +7,11 @@ "related": [], "description": "Returns the milliseconds of the referenced date.", "params": [ - {"name": "date", "description": "date object; for example, now()", "required": true, "default": "", "type": "date", "values": []}, + {"name": "date", "description": "date object", "required": true, "default": "", "type": "date", "values": []}, {"name": "timezone", "description": "A datetime object is independent of a specific timezone; it is only an offset in milliseconds from 1970-1-1 00.00:00 UTC (Coordinated Universal Time).

The timezone only comes into play when you need specific information like hours in a day, minutes in a hour or which day it is as these calculations depend on the timezone.

A timezone must be specified in order to translate the date object to something else. If you do not provide the timezone in the function call, it will default to the timezone specified in the Lucee Administrator (Settings/Regional), or the timezone specified for the current request using the function setTimezone().

You can find a list of all available timezones in the Lucee administrator (Settings/Regional). Some examples of valid timezones include:

", "required": false, "default": "", "type": "string", "values": []} ], "engines": { + "coldfusion": {"minimum_version":"2021", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-m-r/millisecond.html"}, "lucee": {"minimum_version": "", "notes": "", "docs": "https://docs.lucee.org/reference/functions/millisecond.html"} }, "examples": [], diff --git a/guides/en/member.md b/guides/en/member.md index cdbb60284..630d3c0f6 100644 --- a/guides/en/member.md +++ b/guides/en/member.md @@ -25,28 +25,40 @@ The following example depicts the new usage of member functions: myArray.sort("ASC"); // The member way - var myProductObject = createObject("java", "myJavaclass"); - myjavaList = myProductObject.getProductList(); - myjavaList.add("newProduct"); // Java API + var myProductObject = createObject("java", "myJavaClass"); + myJavaList = myProductObject.getProductList(); + myJavaList.add("newProduct"); // Java API - myjavaList.append("newProduct"); // CF API - myjavaList.sort("ASC"); + myJavaList.append("newProduct"); // CF API + myJavaList.sort("ASC"); + +Member Functions can also be chained (on Lucee or CF2018+), for example: + + s = "the"; + s = s.listAppend("quick brown fox", " ") + .listAppend("jumps over the lazy dog", " ") + .uCase() + .reverse(); + +result: `GOD YZAL EHT REVO SPMUJ XOF NWORB KCIUQ EHT` Member functions for the following data types are supported: -- Array -- String -- List -- Struct -- Date -- Spreadsheet -- XML -- Query -- Image +- [Array](#array-member-functions) +- [String](#string-member-functions) +- [List](#list-member-functions) +- [Struct](#struct-member-functions) +- [Date](#date-member-functions) +- [Image](#image-member-functions) +- [Spreadsheet](#spreadsheet-member-functions) +- [XML](#xml-member-functions) +- [Query](#query-member-functions) +- [Numeric](#numeric-member-functions) CF 2016 changed the return type for append member functions: -`anystruct.append()` returns the appended structure -`anyarray.append()` returns the appended array + +- `someArray.append()` now returns the appended array +- `someStruct.append()` now returns the appended structure ## Array member functions @@ -258,6 +270,7 @@ CF 2016 changed the return type for append member functions: - hour : `someVar.hour()` - lsDateFormat : `someVar.lsDateFormat()` - lsTimeFormat : `someVar.lsTimeFormat()` +- millisecond : `someVar.millisecond()` - minute : `someVar.minute()` - month : `someVar.month()` - quarter : `someVar.quarter()` @@ -416,50 +429,54 @@ When using Query.cfc, you get your results from the execution by using: - `someVar.getResult()` -## Display and Formatting member functions - -- booleanFormat : `someVal.booleanFormat()` -- yesNoFormat : `someVal.yesNoFormat()` - ## Numeric member functions - abs : `someVar.abs()` -- aCos : `someVar.aCos()` -- aSin : `someVar.aSin()` +- acos : `someVar.aCos()` +- asin : `someVar.aSin()` - atn : `someVar.atn()` -- bitAnd : `someVar.bitAnd(number2)` -- bitMaskClear : `someVar.bitMaskClear(start, length)` -- bitMaskRead : `someVar.bitMaskRead(start, length)` -- bitMaskSet : `someVar.bitMaskSet(mask, start, length)` +- bitAnd : `someVar.bitAnd()` +- bitMaskClear : `someVar.bitMaskClear()` +- bitMaskRead : `someVar.bitMaskRead()` +- bitMaskSet : `someVar.bitMaskSet()` - bitNOT : `someVar.bitNot()` -- bitOR : `someVar.bitOr(number2)` -- bitSHLN : `someVar.bitSHLN(count)` -- bitSHRN : `someVar.bitSHRN(count)` -- bitXOR : `someVar.bitXor(number2)` +- bitOR : `someVar.bitOr()` +- bitSHLN : `someVar.bitSHLN()` +- bitSHRN : `someVar.bitSHRN()` +- bitXOR : `someVar.bitXor()` - ceiling : `someVar.ceiling()` - cos : `someVar.cos()` - decrementValue : `someVar.decrementValue()` - exp : `someVar.exp()` - fix : `someVar.fix()` - floor : `someVar.floor()` -- formatBaseN : `someVar.formatBaseN(radix)` +- formatBaseN : `someVar.formatBaseN()` - incrementValue : `someVar.incrementValue()` - inputBaseN : `someVar.inputBaseN()` - log : `someVar.log()` - log10 : `someVar.log10()` -- max : `someVar.max(number2)` -- min : `someVar.min(number2)` +- max : `someVar.max()` +- min : `someVar.min()` - precisionEvaluate : `someVar.precisionEvaluate()` -- randomize : `someVar.randomize([algorithm])` -- randRange : `someVar.randRange(number2[, algorithm])` +- randomize : `someVar.randomize()` +- randRange : `someVar.randRange()` - round : `someVar.round()` - sgn : `someVar.sgn()` - sin : `someVar.sin()` - sqr : `someVar.sqr()` - tan : `someVar.tan()` +## Display and Formatting member functions + +- booleanFormat : `someVal.booleanFormat()` +- yesNoFormat : `someVal.yesNoFormat()` + ## Future member functions +These are exclusively member functions and have no headless equivalent. You use them on the Future returned by `runAsync`. + +### Standard Future member functions + - cancel : `FutureObject.cancel()` - error : `FutureObject.error(UDFMethod method)` - error : `FutureObject.then((UDFMethod method, long timeout)` @@ -471,7 +488,7 @@ When using Query.cfc, you get your results from the execution by using: - then : `FutureObject.then(UDFMethod method)` - then : `FutureObject.then((UDFMethod method, long timeout)` -## Empty Future member functions +### Empty Future member functions - cancel : `EmptyFutureObject.cancel()` - complete : `EmptyFutureObject.complete(Object val)` @@ -479,16 +496,6 @@ When using Query.cfc, you get your results from the execution by using: - isCancelled : `EmptyFutureObject.isCancelled()` - isDone : `EmptyFutureObject.isDone()` -Member Functions can also be chained (on Lucee or CF2018+), for example: - - s = "the"; - s = s.listAppend("quick brown fox", " ") - .listAppend("jumps over the lazy dog", " ") - .uCase() - .reverse(); - -result: `GOD YZAL EHT REVO SPMUJ XOF NWORB KCIUQ EHT` - ## Important Note on a potential Member Function Gotcha Some member functions [might fall into underlying Java methods][note] if the strict ColdFusion syntax is not followed.