@discomedia/utils 1.0.35 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-frontend.cjs +5 -5
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +5 -5
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +22 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +22 -5
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +3 -3
- package/dist/test.js +22 -5
- package/dist/test.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/market-time.d.ts +14 -0
- package/dist/types/market-time.d.ts.map +1 -1
- package/dist/types-frontend/index.d.ts +1 -0
- package/dist/types-frontend/index.d.ts.map +1 -1
- package/dist/types-frontend/market-time.d.ts +14 -0
- package/dist/types-frontend/market-time.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -772,6 +772,22 @@ function getNYTimeZone(date) {
|
|
|
772
772
|
const offset = getNYOffset(date || new Date());
|
|
773
773
|
return offset === -4 ? '-04:00' : '-05:00';
|
|
774
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* Converts any date to the market time zone (America/New_York, Eastern Time).
|
|
777
|
+
* Returns a new Date object representing the same moment in time but adjusted to NY/Eastern timezone.
|
|
778
|
+
* Automatically handles daylight saving time transitions (EST/EDT).
|
|
779
|
+
*
|
|
780
|
+
* @param date - Date object to convert to market time zone
|
|
781
|
+
* @returns Date object in NY/Eastern time zone
|
|
782
|
+
* @example
|
|
783
|
+
* ```typescript
|
|
784
|
+
* const utcDate = new Date('2024-01-15T15:30:00Z'); // 3:30 PM UTC
|
|
785
|
+
* const nyDate = convertDateToMarketTimeZone(utcDate); // 10:30 AM EST (winter) or 11:30 AM EDT (summer)
|
|
786
|
+
* ```
|
|
787
|
+
*/
|
|
788
|
+
function convertDateToMarketTimeZone(date) {
|
|
789
|
+
return toNYTime(date);
|
|
790
|
+
}
|
|
775
791
|
/**
|
|
776
792
|
* Returns the current market status for a given date.
|
|
777
793
|
* @param options - { date?: Date }
|
|
@@ -2393,7 +2409,7 @@ const safeJSON = (text) => {
|
|
|
2393
2409
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2394
2410
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
2395
2411
|
|
|
2396
|
-
const VERSION = '5.
|
|
2412
|
+
const VERSION = '5.23.1'; // x-release-please-version
|
|
2397
2413
|
|
|
2398
2414
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2399
2415
|
const isRunningInBrowser = () => {
|
|
@@ -6900,23 +6916,23 @@ class Conversations extends APIResource {
|
|
|
6900
6916
|
/**
|
|
6901
6917
|
* Create a conversation.
|
|
6902
6918
|
*/
|
|
6903
|
-
create(body, options) {
|
|
6919
|
+
create(body = {}, options) {
|
|
6904
6920
|
return this._client.post('/conversations', { body, ...options });
|
|
6905
6921
|
}
|
|
6906
6922
|
/**
|
|
6907
|
-
* Get a conversation
|
|
6923
|
+
* Get a conversation
|
|
6908
6924
|
*/
|
|
6909
6925
|
retrieve(conversationID, options) {
|
|
6910
6926
|
return this._client.get(path `/conversations/${conversationID}`, options);
|
|
6911
6927
|
}
|
|
6912
6928
|
/**
|
|
6913
|
-
* Update a conversation
|
|
6929
|
+
* Update a conversation
|
|
6914
6930
|
*/
|
|
6915
6931
|
update(conversationID, body, options) {
|
|
6916
6932
|
return this._client.post(path `/conversations/${conversationID}`, { body, ...options });
|
|
6917
6933
|
}
|
|
6918
6934
|
/**
|
|
6919
|
-
* Delete a conversation
|
|
6935
|
+
* Delete a conversation. Items in the conversation will not be deleted.
|
|
6920
6936
|
*/
|
|
6921
6937
|
delete(conversationID, options) {
|
|
6922
6938
|
return this._client.delete(path `/conversations/${conversationID}`, options);
|
|
@@ -18979,6 +18995,7 @@ const disco = {
|
|
|
18979
18995
|
calculateFibonacciLevels: calculateFibonacciLevels,
|
|
18980
18996
|
},
|
|
18981
18997
|
time: {
|
|
18998
|
+
convertDateToMarketTimeZone: convertDateToMarketTimeZone,
|
|
18982
18999
|
getStartAndEndDates: getStartAndEndDates,
|
|
18983
19000
|
getMarketOpenClose: getMarketOpenClose,
|
|
18984
19001
|
getLastFullTradingDate: getLastFullTradingDate,
|