mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: Test failing for toDate from string extension test (no-changelog) (#5142)
This commit is contained in:
@@ -31,3 +31,12 @@ export const evaluate = (value: string, values?: INodeExecutionData[]) =>
|
||||
'America/New_York',
|
||||
{},
|
||||
);
|
||||
|
||||
export const getLocalISOString = (date: Date) => {
|
||||
const offset = date.getTimezoneOffset();
|
||||
const offsetAbs = Math.abs(offset);
|
||||
const isoString = new Date(date.getTime() - offset * 60 * 1000).toISOString();
|
||||
const hours = String(Math.floor(offsetAbs / 60)).padStart(2, '0');
|
||||
const minutes = String(offsetAbs % 60).padStart(2, '0');
|
||||
return `${isoString.slice(0, -1)}${offset > 0 ? '-' : '+'}${hours}:${minutes}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user