passport.authenticate is not working – LinkedIn OAuth

I have been trying to implement linked OAuth with passport.js, but I keep getting the message the application is disabled

linkedin oauth page
I have rechecked the code multiple times but can’t find anything wrong with the implementation. I have also tried troubleshooting by logging messages, but there are no errors. The passport.authenticate is not being executed because the only thing on the console is the this is where authentication will be done message.

This is what the LinkedIn route looks like:

app.get('/api/auth/linkedin', async (req: Request, res: Response, next: NextFunction) => {
  console.log('this is where authentication will be done');

  return passport.authenticate('linkedin', {
    scope: ['r_emailaddress', 'r_liteprofile'],
    state: JSON.stringify(req.query),
  })(req, res, next);
});

This is the passport strategy implementation:

passport.use(
 new LinkedInStrategy.Strategy(
  {
   clientID: process.env.LINKED_IN_CLIENT_ID,
   clientSecret: process.env.LINKED_IN_CLIENT_SECRET,
   callbackURL: process.env.LINKED_IN_CALL_BACK_URL,
   scope: ['r_emailaddress', 'r_liteprofile'],
  },
  async (accessToken, refreshToken, profile: any, done) => {
  console.log('linkedin passport callback function fired');
  const email = profile.emails[0]?.value;
  const displayName = profile.displayName;
  const familyName = profile.name?.familyName;
  const givenName = profile.name?.givenName;
  const fullName = displayName || givenName + familyName || familyName;
  const photo_url = profile.photos?.[0]?.value || '';

  const user: any = await userService.confirmSocialMediaAccount({
    email,
    photo_url,
    source: 'linkedin',
    fullName,
    modificationNotes: [
      {
        modifiedOn: new Date(Date.now()),
        modifiedBy: null,
        modificationNote: 'New user created',
      },
    ],
  });
  done(null, user);
}

)
);

And this is what the call-back route looks like:

app.get('/api/auth/linkedin/callback', (req: Request, res: Response, next: NextFunction) => {
  console.log('Handling LinkedIn callback');
  passport.authenticate('linkedin', { failureRedirect: '/login' }, (err, user) => {
    if (err) {
      console.error('Authentication Error:', err);
      return next(err);
    }
    if (!user) {
      return res.redirect('/login');
    }
    console.log('User authenticated:', user);
  })(req, res, next);
});

Leonardo Login with CloudFlare security

I am working with the automation for the leonardo.ai where there is CloudFlare checkbox, have tried to pass it even with manual process still i am stuck in a loop. i tried undetected_chromedriver also and it bypassed the thing for the first time, but after click on login it takes me to the login page again saying that captcha verification failed. even marking it manually making me in loop don’t know what to do ? any help will be grateful.
enter image description here

def main():
    options = uc.ChromeOptions()
    options.add_argument("--no-sandbox")
    options.add_argument("--disable-blink-features=AutomationControlled")
    options.add_experimental_option("debuggerAddress", "localhost:9222")  
    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
    file_path = 'D:\Fiverr\ideogram\propmpts.xlsx'
    prompts = read_prompts_from_xlsx(file_path)
    os.makedirs('images', exist_ok=True)
    prompt_count = 0



def login(driver, email, password):
    print("let's login with new credentials")
    driver.get('https://app.leonardo.ai/auth/login')
    time.sleep(5)
    wait = WebDriverWait(driver, 10)
    email_field = wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="email"]')))
    email_field.send_keys(email)
    password_field = wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="password"]')))
    password_field.send_keys(password)
    check = input("Please check the cloudflair: ")
    if(check != 'y'):
        print("Please try re run the script and select cloudflair security mannually")
    sign_in = wait.until(EC.presence_of_element_located((By.XPATH, "//button[normalize-space()='Sign in']")))
    # driver.execute_script("arguments[0].removeAttribute('disabled')", sign_in)
    sign_in.click()

Set cursor when drag and drop out of browser onto desktop

I am looking to implement dragging a div outside the browser window and it creating a new window with the div in it.

Whilst my code probably isn’t perfect, I can do that with this:

let dragged = null;
let dropTarget = null;

document.addEventListener("dragstart", e => dragged = e.target);
document.addEventListener("dragend", e => {
  if (dropTarget == null) {
    const w = window.open("", "_blank", `height=200,width=200,left=${e.screenX},top=${e.screenY},toolbar=0,location=0,menubar=0`);
    w.document.body.appendChild(dragged);
  }
});

document.addEventListener("dragenter", e => dropTarget = e.target);
document.addEventListener("dragleave", e => {
  if (dropTarget == e.target) {
    dropTarget = null;
  }
});
<div draggable="true">Draggable div</div>
 

When dragging outside the window onto the desktop, the cursor icon is not-allowed.

If there is anyway I can trick the browser into thinking the drop is allowed (with a better icon) without actually performing a drop, but instead opening the new window?

Yii2 prevent form submit with vanilla js

i have a form in a modal, when i click on submit button i want to prevent the form submission using vanilla js.
But if i use preventDefault(); like this code

form.addEventListener('beforeSubmit', function(event) {
   event.preventDefault();
   //Ajax submit
})

i get 2 submit events in my form end the form is sent…
Instead if a use jquery

$("#formCalendar").on('beforeSubmit', function (event) {
      event.preventDefault();
      //Ajax submit
      return false;
})

It works…
Why with vanilla js doesn’t work?

Input Field value passed by using selenium disappears

An input field deletes the value after it’s entered using SendKeys via JS in Selenium. The value appears briefly, then disappears. How to fix this?
I am using Java with selenium & maven.

WebDriverWait wait = new WebDriverWait(DriverManager.getDriver(), Duration.ofSeconds(10));
 WebElement field = wait.until(ExpectedConditions.elementToBeClickable(By.id("spocData[0].spocDetails.email")));
 
 JavascriptExecutor js = (JavascriptExecutor) DriverManager.getDriver();
 js.executeScript("arguments[0].scrollIntoView(true);", field);
 js.executeScript("arguments[0].value='[email protected]';", field);

I have tried multiple xpath.
Selenium Sendkeys method.
Sendkeys by Mouse Actions.
Tried Resetup of whole project.

I need block/unblock feature for our app but “Unblock” part is not working

I have an issue with my code, and ChatGPT and Microsoft Copilot don’t fix my issue. Even I have sent all the codes and screenshots.

Here is my HTML code.


        <!-- MESSENGER -->
        <div class="messenger">
            <!-- LEFT -->
            <div class="left-block">
                <div class="search-box">
                    <div class="input-with-icon">
                        <div class="search-input-dark">
                            <input
                                class="form-control"
                                placeholder="Search..."
                            />
                            <i class="bi-search"></i>
                        </div>
                    </div>
                </div>
                <hr />
                <div class="chat-boxes">
                    <div class="chat-box" id="chat-box-1">
                        <img
                            class="avatar-56"
                            src="img/avatar-model.png"
                            alt=""
                        />
                        <div class="chat-content">
                            <div class="chat-top">
                                <div class="name">
                                    <h6 class="fw-medium">Penny Sinnap</h6>
                                </div>

                                <div class="time-and-dots">
                                    <p class="time">30 sec.ago</p>
                                    <div
                                        class="icon-wrapper three-dots"
                                        data-bs-toggle="dropdown"
                                        aria-expanded="false"
                                    >
                                        <i class="bi-three-dots"></i>
                                    </div>
                                    <ul class="dropdown-menu dropdown-menu-end">
                                        <li>
                                            <a
                                                id="blockOption"
                                                class="dropdown-item"
                                                href="#"
                                                data-bs-toggle="modal"
                                                data-bs-target="#blockModal"
                                                data-chat-box-id="chat-box-1"
                                                >Block User</a
                                            >
                                        </li>
                                        <li>
                                            <a
                                                class="dropdown-item delete-chat-trigger"
                                                href="#"
                                                data-bs-toggle="modal"
                                                data-bs-target="#deleteModal"
                                                data-chat-box-id="chat-box-2"
                                                >Delete Chat</a
                                            >
                                        </li>
                                    </ul>
                                    <!-- 3 DOTS MODALS -->

                                    <!-- 3 DOTS MODALS -->

                                    <!-- 3 DOTS TOASTERS -->

                                    <!-- Block Toast -->
                                    <div
                                        class="toast-container position-fixed bottom-0 end-0 p-3"
                                    >
                                        <div
                                            id="blockToast"
                                            class="toast align-items-center"
                                            role="alert"
                                            aria-live="assertive"
                                            aria-atomic="true"
                                        >
                                            <div class="d-flex">
                                                <div class="toast-body">
                                                    You have successfully
                                                    blocked
                                                    <strong
                                                        >Penny Sinnap</strong
                                                    >
                                                </div>
                                                <button
                                                    type="button"
                                                    class="btn-close me-2 m-auto"
                                                    data-bs-dismiss="toast"
                                                    aria-label="Close"
                                                ></button>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- Block Toast -->

                                    <!-- Delete Toast -->
                                    <div
                                        class="toast-container position-fixed bottom-0 end-0 p-3"
                                    >
                                        <div
                                            id="deleteToast"
                                            class="toast align-items-center"
                                            role="alert"
                                            aria-live="assertive"
                                            aria-atomic="true"
                                        >
                                            <div class="d-flex">
                                                <div class="toast-body">
                                                    Your chat successfully
                                                    deleted.
                                                </div>
                                                <button
                                                    type="button"
                                                    class="btn-close me-2 m-auto"
                                                    data-bs-dismiss="toast"
                                                    aria-label="Close"
                                                ></button>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- Delete Toast -->

                                    <!-- 3 DOTS TOASTERS -->
                                </div>
                            </div>
                            <p>
                                Id ipsum in cras volutpat nam sollicitudin diam
                                vitae. Habitant sit sodales placerat. Id ipsum
                                in cras volutpat nam sollicitudin diam vitae.
                                Habitant sit sodales placerat.Id ipsum in cras
                                volutpat nam sollicitudin diam vitae. Habitant
                                sit sodales placerat. Id ipsum in cras volutpat
                                nam sollicitudin diam vitae. Habitant sit
                                sodales placerat.
                            </p>
                        </div>
                        <div class="block-overlay hidden" id="block-overlay-1">
                            <div class="block-message">
                                You have blocked <strong>Penny Sinnap.</strong>
                            </div>
                            <div
                                class="icon-wrapper three-dots"
                                data-bs-toggle="dropdown"
                                aria-expanded="false"
                            >
                                <i class="bi-three-dots"></i>
                            </div>
                            <ul class="dropdown-menu dropdown-menu-end">
                                <li>
                                    <a
                                        id="blockOption"
                                        class="dropdown-item"
                                        href="#"
                                        data-bs-toggle="modal"
                                        data-bs-target="#blockModal"
                                        >Unblock User</a
                                    >
                                </li>
                                <li>
                                    <a
                                        id="deleteButton"
                                        class="dropdown-item"
                                        href="#"
                                        data-bs-toggle="modal"
                                        data-bs-target="#deleteModal"
                                        >Delete Chat</a
                                    >
                                </li>
                            </ul>
                        </div>
                    </div>
                    <hr />
                    
(And other checboxes...)
[enter image description here](https://i.sstatic.net/yhSYY80w.png)
                    <!-- Block/Unblock Modal -->
                    <div
                        class="modal fade warning-modals"
                        id="blockModal"
                        tabindex="-1"
                        aria-labelledby="blockModalLabel"
                        aria-hidden="true"
                    >
                        <div class="modal-dialog modal-dialog-centered">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5
                                        class="modal-title fs-5 fw-medium"
                                        id="blockModalLabel"
                                    >
                                        Block User
                                    </h5>
                                    <button
                                        type="button"
                                        class="btn-close"
                                        data-bs-dismiss="modal"
                                        aria-label="Close"
                                    ></button>
                                </div>
                                <div class="modal-body">
                                    <p>
                                        Are you sure you want to block
                                        <strong class="chat-user-name"
                                            >Penny Sinnap</strong
                                        >?
                                    </p>
                                </div>
                                <div class="modal-footer">
                                    <button
                                        type="button"
                                        class="btn btn-link close-button"
                                        data-bs-dismiss="modal"
                                    >
                                        Cancel
                                    </button>
                                    <button
                                        id="blockToastBtn"
                                        type="button"
                                        class="btn btn-primary"
                                    >
                                        Block
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <hr />
                </div>
                <hr />
            </div>
            <!-- LEFT -->
        </div>
        <!-- MESSENGER -->

And here is my javascript code:

$(document).ready(function () {
    var chatBoxToBlock;

    // Capture the chat-box ID when the block-user link is clicked
    $('.dropdown-item[data-bs-target="#blockModal"]').on('click', function () {
        const chatBoxId = $(this).closest('.chat-box').attr('id');
        chatBoxToBlock = chatBoxId;
        updateBlockModalContent(chatBoxToBlock);
    });

    $('#blockToastBtn').click(function () {
        toggleBlock(chatBoxToBlock);
        $('#blockModal').modal('hide');
    });

    $('#blockModal').on('hidden.bs.modal', function () {
        chatBoxToBlock = null;
    });

    function updateBlockModalContent(chatBoxId) {
        var chatUser = $('#' + chatBoxId)
            .find('.name h6')
            .text();
        var isBlocked =
            $('#' + chatBoxId)
                .find('.dropdown-item[data-bs-target="#blockModal"]')
                .text()
                .trim() === 'Unblock User';

        var modalLabel = isBlocked ? 'Unblock User' : 'Block User';
        var actionText = isBlocked ? 'unblock' : 'block';
        var buttonText = isBlocked ? 'Unblock' : 'Block';

        // Update modal content based on block/unblock state
        $('#blockModalLabel').text(modalLabel);
        $('#blockModal .modal-body').html(
            '<p>Are you sure you want to ' +
                actionText +
                ' <strong>' +
                chatUser +
                '</strong>?</p>'
        );
        $('#blockToastBtn').text(buttonText);
    }

    function toggleBlock(chatBoxId) {
        var isBlocking = $('#blockToastBtn').text().trim() === 'Block';

        // Toggle the overlay visibility for blocking/unblocking
        var overlay = $('#' + chatBoxId).find('.block-overlay');
        if (isBlocking) {
            overlay.removeClass('hidden').addClass('visible');
        } else {
            overlay.removeClass('visible').addClass('hidden');
        }

        // Update button and dropdown item text for Block/Unblock
        $('#' + chatBoxId)
            .find('.dropdown-item[data-bs-target="#blockModal"]')
            .text(isBlocking ? 'Unblock User' : 'Block User');

        // Show toast message
        showToast(
            isBlocking ? 'You have blocked ' : 'You have unblocked ',
            chatBoxId
        );
    }

    function showToast(message, chatBoxId) {
        var chatUser = $('#' + chatBoxId)
            .find('.name h6')
            .text();
        $('#blockToast .toast-body').text(message + chatUser + '.');
        var toast = new bootstrap.Toast($('#blockToast'));
        toast.show();
    }
});

Everything works till you block the user. But when I click “Unblock”, I want to update these three labels:

1- “Block user” title should be “Unblock user”
2- “Are you sure you want to block Penny Sinnap?” should be “Are you sure you want to unblock Penny Sinnap?”
3- “Block” button should be “Unblock”

And I have added a screenshot for my issue.

Plus, I also want to be sure that after “Unblock” user, the overlay should disappear.

This is my first question on Stackover Flow. I hope I could have shared my issue in the correct way; if I couldn’t, my apologies. :/

Screenshot

Best API for Live Audio Transcription with Intermittent Input? [closed]

I’m looking to implement live transcription in a JavaScript project where the audio input may periodically stop and restart in short intervals (a few seconds). I’ve tested OpenAI’s Whisper, but it doesn’t seem to be optimized for live transcription and doesn’t support data streaming.

Can anyone recommend an API that works well for this type of use case, where the audio input can be intermittent?

Getting AWS cognito attributes

import { useState, useEffect } from "react";
import { fetchUserAttributes } from "aws-amplify/auth";
import { useNavigate } from "react-router-dom"; // Add react-router-dom for navigation

function App(props) {  // No need for WithAuthenticatorProps here in JavaScript
  const [email, setEmail] = useState(""); // Email state
  const [userGroups, setUserGroups] = useState([]); // Explicitly declare as empty array
  const navigate = useNavigate(); // Hook for navigation

  useEffect(() => {
    // Fetch user attributes, including groups
    fetchUserAttributes().then((userAttrs) => {
      setEmail(userAttrs.email || "");
    })    .catch((error) => {
      console.error("Error fetching user attributes", error);
    });;
  }, [navigate]);

  return (
    <>
      <p>Hello {email}</p>
      <p>
        You can <button onClick={props.signOut}>logout</button>
      </p>
    </>
  );
}

export default App;

I am trying to get the email attribute from the user. Upon logging in, I get this error:
“Error fetching user attributes NotAuthorizedException: Access Token does not have required scopes”

I have already set the scope to include “openid” and “email” when configuring AWS Amplify as well as on the Cognito App Client side. I can log in successfully but cannot retrieve the email. How can I fix this?

I set the scopes to “openid” and “email” here. (and on the App Client)

// Configure AWS Amplify
Amplify.configure({
  Auth: {
    Cognito: {
      loginWith: {
        oauth: {
          redirectSignIn: ["http://localhost:5173"],
          redirectSignOut: ["http://localhost:5173"],
          domain: "us-east-domain",
          providers: ["Google"],
          scopes: ["openid", "email"],
          responseType: "code",
        },
      },
      userPoolId: "userpoolid",
      userPoolClientId: "userpoolclientid",
    },
  },
});

Error: an Illustrator error occurred: 1346458189 (‘PARM’) (illustrator v2024)

I have been getting these errors very often in almost my simplest scripts for a long time. I am getting this warning even though I have tried all the alternatives thinking it may be in the coordinate system. When I researched, there are people who get similar errors but no definitive solution has been provided.

//this script task: Adds the selected objects to the page in cm.
// The error it gives every now and then is:
// Error: an Illustrator error occurred: 1346458189 ('PARM')
#target illustrator
offsetT=0 
var myDoc = app.activeDocument;
myDoc.rulerOrigin = [0,0];
var sel = app.selection; //sel as selections array.
var str = "";
function essenziki() {
    if(sel.length==0){
        alert("choose something first");
        return
     }

for (var i = 0; i < sel.length; i++) { //loop and check each selected objects
  str += (pt2mm(sel[i].width) / 10+offsetT).toFixed(0) + "*" + (pt2mm(sel[i].height) / 10+offsetT).toFixed(0)+ "n";
}
str = str.replace(/n$/, ''); // Replace last line break to empty symbol
var tx = myDoc.textFrames.add();
    tx.contents = str;
tx.textRange.characterAttributes.size=150; 
tx.textRange.characterAttributes.textFont = app.textFonts.getByName('Arial-BoldMT');

app.executeMenuCommand("deselectall"); //deselect all abjects

var cmykColor = new CMYKColor();
cmykColor.cyan = 34;
cmykColor.magenta = 49;
cmykColor.yellow = 19;
cmykColor.black = 27;
tx.textRange.characterAttributes.fillColor = cmykColor; 

app.executeMenuCommand("deselectall"); //deselect all abjects
    tx.selected = true; 

function pt2mm(n){
  return n * 0.35277778;
}

};
essenziki();

if (app.selection.length > 0) {
    var selectedItem = app.selection[0]; // Get the first selected item

    // Get the center of the current view in document coordinates
    var viewCenter = app.activeDocument.activeView.centerPoint; // [x, y] of view center in document coordinates

    // Calculate the center of the selected item
    var itemBounds = selectedItem.geometricBounds; // [left, top, right, bottom]
    var itemCenterX = (itemBounds[0] + itemBounds[2]) / 2;
    var itemCenterY = (itemBounds[1] + itemBounds[3]) / 2;

    // Calculate the offset to move the item to the center of the view
    var offsetX = viewCenter[0] - itemCenterX;
    var offsetY = viewCenter[1] - itemCenterY;

    // Move the item to the center of the view
    selectedItem.translate(offsetX, offsetY);
}

How to Integrate Mollie Payments in Medusa.js v2?

I am working on a Medusa.js v2 project and need to integrate Mollie as a payment gateway. I have gone through the Medusa documentation and the Mollie API documentation, but I am unclear about the steps required to configure Mollie payments in Medusa v2.

Here are my specific questions:

Installation and Configuration:

Which Medusa module or package should I use to integrate Mollie?
How should I configure the environment variables for Mollie, such as API keys, webhook URLs, etc.?
Integration Steps:

What are the necessary steps to enable Mollie payments in Medusa v2?
Do I need to make any changes to the backend, or is there a specific plugin to handle this?
Testing:

How can I test the Mollie payment integration locally or in a staging environment?
Are there any recommended tools or techniques for debugging issues during the payment process?
If anyone has successfully integrated Mollie with Medusa.js v2 or can provide guidance, I would greatly appreciate your help. Detailed instructions or references to relevant examples would be extremely helpful.

Thank you!

Shift + Tab Backward Navigation Skipping Elements

I’m experiencing an issue with keyboard navigation on my website. When I use the Tab key to navigate forward through interactive elements, everything works as expected (I can tab through <a> element with link_class and <button> element with button class). However, when I try to navigate backward using Shift + Tab, it skip button element and directly go to the <a> element.

<div class="container">
    <a href="link.html" class="link_class">
        <span class="text">
            Layouts
        </span>
    </a>
    <button class="button"></button>
</div>

Is there a way to link my node js code to my website?

My code is a web scrapper(currently runs with a .txt file for inputs) and I want to link it to my website yet I have no clue how to go about it.
Essentially, I want to create a monthly subscription and for customers to enter requests and my code to fulfil them.
how would I go about this? Its almost like I need a messaging service to connect both together.
Thank you

ScrollIntoView scrolls properly only when triggered twice

I use scrollIntoView in a Table of Content feature in a blog. When the user clicks on an item from the table of content, they are scrolled to the selected section.

However, on the initial click of an item, the user isn’t scrolled at the exact start of the section but just a bit under it.

Here comes the fun part, once the user selects the same item in the Table of Contents, they are properly scrolled to the start of the section.

So basically, the user needs to select a section twice before being scrolled to the exact start of the section.

This has been bugging me for a couple of hours now.

Any ideas what could be doing this?

Just for context I am using Vue.js 3 and below is the function that simply takes an element ID and scrolls to it.

The whole content I am rendering comes from CMS in the form of HTML and I am using the v-html binding to render it.

function handleTocClick(elementId) {
    isDropdownOpen.value = false;
    const element = document.getElementById(elementId);
    element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
}

I tried different scrollIntoView options like block: start or block: end.
I also tried removing my scroll-margin-top as I thought it could be causing this discrepancy, but nope, it is something else.
I also played with Vue’s nextTick() like:

function handleTocClick(elementId) {
isDropdownOpen.value = false;
nextTick(() => {
    const element = document.getElementById(elementId);
    element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
});

}

Full example:

<template>
    <h6 @click="toggleTocDropdown">Table of content</h6>
    <ul
        :class="[
            'toc-list',
            {
                dropdown: isMobile,
                open: isDropdownOpen && isMobile,
            },
        ]"
    >
        <li v-for="(article, index) in articleHeadings">
            <a @click="handleTocClick(article.id)">{{ article.h2 }}</a>
        </li>
    </ul>
    <div class="article-text">
        <section v-for="(section, index) in articleSections" :id="section.id">
            <h2 v-if="section.h2">
                {{ section.h2 }}
            </h2>
            <div v-html="section.content"></div>
        </section>
    </div>
</template>
<script setup>
function handleTocClick(elementId) {
    const element = document.getElementById(elementId);
    element.scrollIntoView({
        behavior: 'smooth',
        block: 'start',
        inline: 'start',
    });
    isDropdownOpen.value = false;
}
</script>

comment trouvez une entreprise de construction?

La fabrication de charpente métallique est un élément clé pour les projets de construction nécessitant robustesse et durabilité. Grâce à leur savoir-faire, l’équipe a su concevoir une structure métallique sur mesure répondant parfaitement à nos besoins, avec une précision exceptionnelle et un respect des délais strict.
Leur service d’usinage CNC combine efficacité et précision, ce qui en fait un choix parfait pour les industries nécessitant des pièces sur mesure. Les matériaux utilisés sont travaillés avec un soin particulier, garantissant une finition impeccable et une durabilité optimale.

Parlez-vous d’une expérience, d’un processus ou d’une tâche où les résultats n’ont pas correspondu aux attentes ?

Date Java vs Date Javascipt

I have a question that I haven’t found the answer to.. “Why is there a difference in special date return values ​​between JAVA and JAVASCRIPT?” I hope everyone can answer.

Java code:

package org.example;

import java.util.Date;

public class Main {
    public static void main(String[] args) {
        System.out.println("current date: " + new Date());
        System.out.println("special date: " + new Date(-27080636400000L));
    }
}

// Result:
// current date: Mon Dec 02 16:02:00 ICT 2024
// special date: Wed Nov 01 00:00:00 ICT 1111

Javascript code:

console.log("current date:", new Date())
console.log("special date:", new Date(-27080636400000))

// Result:
// current date: Mon Dec 02 2024 16:01:48 GMT+0700
// special date: Wed Nov 08 1111 00:06:30 GMT+0706

I have tried to find out and have not found the right keyword to answer the question

UPDATE

Thanks guys, the problem seems to be due to different languages

I have another question, how can I get the same input -27080636400000 and both languages ​​return the result in the format dd/mm/yyyy which is 01/11/1111