This commit is contained in:
MuslemRahimi 2025-02-17 17:22:01 +01:00
parent b807ffde9b
commit 311160d2bd
9 changed files with 99 additions and 137 deletions

View File

@ -225,24 +225,20 @@
} }
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
async function handleScroll() { async function handleScroll() {

View File

@ -73,26 +73,21 @@
} }
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
function getScroll() { function getScroll() {
const scrollThreshold = container.scrollHeight * 0.8; // 80% of the container height const scrollThreshold = container.scrollHeight * 0.8; // 80% of the container height

View File

@ -249,24 +249,20 @@
} }
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
async function handleScroll() { async function handleScroll() {

View File

@ -39,26 +39,21 @@
let displayTimePeriod = "oneYear"; let displayTimePeriod = "oneYear";
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
function changeVolumeOI(event) { function changeVolumeOI(event) {
displayData = event.target.value; displayData = event.target.value;
} }

View File

@ -51,24 +51,20 @@
let otmPercentage; let otmPercentage;
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
function computeOTM(strikePrice, optionType) { function computeOTM(strikePrice, optionType) {

View File

@ -36,24 +36,20 @@
let displayTimePeriod = "oneYear"; let displayTimePeriod = "oneYear";
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
function changeVolumeOI(event) { function changeVolumeOI(event) {

View File

@ -51,24 +51,20 @@
let otmPercentage; let otmPercentage;
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
function computeOTM(strikePrice, optionType) { function computeOTM(strikePrice, optionType) {

View File

@ -39,24 +39,20 @@
let displayTimePeriod = "oneYear"; let displayTimePeriod = "oneYear";
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
function changeVolumeOI(event) { function changeVolumeOI(event) {

View File

@ -51,24 +51,20 @@
let otmPercentage; let otmPercentage;
function formatDate(dateStr) { function formatDate(dateStr) {
// Parse the input date string (YYYY-mm-dd) // Convert the input date string to a Date object in New York time
var date = new Date(dateStr); let date = new Date(dateStr + "T00:00:00Z"); // Assume input is in UTC
// Get month, day, and year // Convert to New York Time Zone
var month = date.getMonth() + 1; // Month starts from 0 let options = {
var day = date.getDate(); timeZone: "Europe/Berlin",
var year = date.getFullYear(); month: "2-digit",
day: "2-digit",
year: "2-digit",
};
// Extract the last two digits of the year let formatter = new Intl.DateTimeFormat("en-US", options);
var shortYear = year.toString().slice(-2);
// Add leading zeros if necessary return formatter.format(date);
month = (month < 10 ? "0" : "") + month;
day = (day < 10 ? "0" : "") + day;
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
} }
function computeOTM(strikePrice, optionType) { function computeOTM(strikePrice, optionType) {