javascript converting datestring to epoch returns three digits too much

I am converting a string to epoch like this:

    arrival = $('#aircraft_arrival_time').val();
console.log(arrival); //2023-12-09T14:03
    temp = arrival.split("T");
    arrivalDatePart = temp[0];
    arrivalDate = arrivalDatePart + "T00:00:00.000Z";
console.log(arrivalDate); //2023-12-09T00:00:00.000Z
    chartFrom = Date.parse(arrivalDate); //beginning of that day, UTC
console.log(chartFrom); //1702080000000

    var f = new Date(0); // The 0 there is the key, which sets the date to the epoch
    f.setUTCSeconds(chartFrom);
console.log(f); //Tue Oct 09 55906 02:00:00 GMT+0200 (centraleuropeisk sommartid)

The trouble is that it returns the epoch in milliseconds, and while running that through something like https://www.epochconverter.com/ it will be identified as millisecond format, and correctly interpreted as 9 December 2023 rather than the year 55906 =)

I assume I could check the length of chartFrom and divide by 1000 if the length is unexpectedly long, but is there a clean way to do it right?

enter image description here

enter image description here

Older browser compatibility with using the DOM to change element styles?

I’ve checked http://caniuse.com and MDN, but didnt get conclusive answers. MDN says document.getElementByID is supported since older browsers but not sure if the .style property is included in that support when doing this:

document.getElementByID('changeStyle').style.color = 'yellow'

This makes me worry that the element might not change the style after triggering the event.

Any help appreciated!

JavaScript Promise Implementation – Are Promise Computation Functions supposed to be executed Asynchronously?

I am new to JavaScript and taking a deep dive into Promises. I am watching this video here where they implement a Promise from scratch:

https://www.youtube.com/watch?v=4GpwM8FmVgQ&t=449s

By “computation function”, they refer to the function being passed into the Promise constructor. At around 6:23 they wrap the execution of the computation function in a setTimeout() with no delay, so as to satisfy 2.2.4 of the Promises/A+ specification found here:

https://promisesaplus.com/

From what I understand, the specification basically wants to ensure that onFulfilled or onRejected are not called until the iteration of the event loop after .then() has been called.

While the implementation in the video satisfies this, it also forces the entire computation function to be executed asynchronously, as opposed to forcing only the onFulfilled and onRejected to execute asynchronously (which is the specification requirement we want to satisfy).

So then I ask, is the computation function supposed to be executed asynchronously? From what I’ve read, different browsers have slightly different implementations for Promises, and so I can’t find a direct answer. I know Promises are intended to be used to do asynchronous work, but let’s say for whatever reason you only do synchronous work in the promise computation function. If the implementation of the Promise calls the computation synchronously (which is what I’ve seen a lot of sources say), the order in which things execute would be very different than if it were called asynchronously (think having console.log() in the computation function, onFulfilled, etc).

It would seem to me that the implementation in the video would be incorrect, if the computation function is not supposed to be called asynchronously. I would have put the setTimeout() in the _onFulfilled or _onRejected functions he had defined. I suppose you could have also put it in the then(). I asked ChatGPT to spit out a sample implementation and it too did something similar, not calling the computation function itself asynchronously.

Is my intuition/understanding correct? Or is it correct to wrap the execution of the computation function in something like a setTimeout because it (the computation function) is supposed to be executed asynchronously? Thanks in advance. Below is the rest of the source code for the implementation:

https://github.com/lowbyteproductions/Promises-From-Scratch/blob/master/index.js

Filtering Nested Object Array By Property Not Working

I have an array of orders which has an array of lineItems and the line Items have an array of categories attached to them. I am trying to filter the order array based on category id of the line item but am running into trouble. I did the something similar for filtering by item but the 3rd layer is giving me issues. I am trying to avoid using too many for loops.

My array is:

[
{
    "href": "https://sandbox.dev.clover.com/v3/merchants/6RD8H04A896K1/orders/937K8W59RPEHW",
    "id": "937K8W59RPEHW",
    "currency": "USD",
    "employee": {
        "id": "VH7JB40JRGCAG"
    },
    "total": 1165,
    "paymentState": "OPEN",
    "title": "[email protected] safs",
    "orderType": {
        "id": "YT62H0SSGJF0M"
    },
    "taxRemoved": false,
    "isVat": false,
    "state": "open",
    "manualTransaction": false,
    "groupLineItems": false,
    "testMode": false,
    "createdTime": 1702095585000,
    "clientCreatedTime": 1702095585000,
    "modifiedTime": 1702095597000,
    "lineItems": [
        {
            "id": "F7W4DXKZNA4NP",
            "orderRef": {
                "id": "937K8W59RPEHW"
            },
            "item": {
                "id": "A5JPMS665CQW6"
            },
            "name": "Chicken Supreme Bowl /G,O With Bread",
            "alternateName": "",
            "price": 1099,
            "itemCode": "",
            "note": "",
            "printed": false,
            "createdTime": 1702095585000,
            "orderClientCreatedTime": 1702095585000,
            "exchanged": false,
            "refunded": false,
            "isRevenue": true,
            "categories": [
                {
                    "id": "55DYZ8T2ZVB88",
                    "name": "Bowl",
                    "sortOrder": 20,
                    "deleted": false
                }
            ]
        }
    ]
},
{
    "href": "https://sandbox.dev.clover.com/v3/merchants/6RD8H04A896K1/orders/3T3YN416MASV2",
    "id": "3T3YN416MASV2",
    "currency": "USD",
    "employee": {
        "id": "VH7JB40JRGCAG"
    },
    "total": 4025,
    "paymentState": "OPEN",
    "title": "[email protected] gsrw",
    "orderType": {
        "id": "YT62H0SSGJF0M"
    },
    "taxRemoved": false,
    "isVat": false,
    "state": "open",
    "manualTransaction": false,
    "groupLineItems": false,
    "testMode": false,
    "createdTime": 1702095600000,
    "clientCreatedTime": 1702095600000,
    "modifiedTime": 1702095611000,
    "lineItems": [
        {
            "id": "AJWXHE6JE2W4T",
            "orderRef": {
                "id": "3T3YN416MASV2"
            },
            "item": {
                "id": "VNRDHNRBG5AVM"
            },
            "name": "Baklava 1 Tray",
            "alternateName": "",
            "price": 1499,
            "itemCode": "",
            "note": "",
            "printed": false,
            "createdTime": 1702095600000,
            "orderClientCreatedTime": 1702095600000,
            "exchanged": false,
            "refunded": false,
            "isRevenue": true,
            "categories": [
                {
                    "id": "TB58V8F5HTGYM",
                    "name": "DESSERTS",
                    "sortOrder": 15,
                    "deleted": false
                }
            ]
        },
        {
            "id": "F4VYPXC1X9J1J",
            "orderRef": {
                "id": "3T3YN416MASV2"
            },
            "item": {
                "id": "QXBQAMMZR8M6T"
            },
            "name": "Veggie Fried Rice",
            "alternateName": "",
            "price": 1199,
            "itemCode": "",
            "note": "",
            "printed": true,
            "createdTime": 1702095600000,
            "orderClientCreatedTime": 1702095600000,
            "exchanged": false,
            "refunded": false,
            "isRevenue": true,
            "categories": [
                {
                    "id": "F4HYDJAKE13K0",
                    "name": "FRIED RICE",
                    "sortOrder": 13,
                    "deleted": false
                }
            ]
        },
        {
            "id": "ZAECC4E18MB5T",
            "orderRef": {
                "id": "3T3YN416MASV2"
            },
            "item": {
                "id": "A5JPMS665CQW6"
            },
            "name": "Chicken Supreme Bowl /G,O With Bread",
            "alternateName": "",
            "price": 1099,
            "itemCode": "",
            "note": "grgre",
            "printed": false,
            "createdTime": 1702095600000,
            "orderClientCreatedTime": 1702095600000,
            "exchanged": false,
            "refunded": false,
            "isRevenue": true,
            "categories": [
                {
                    "id": "55DYZ8T2ZVB88",
                    "name": "Bowl",
                    "sortOrder": 20,
                    "deleted": false
                }
            ]
        }
    ]
}]

the category I am trying to filter by is:

{id: "55DYZ8T2ZVB88", name:"Bowl"}

my code for filtering is:

this.orders.filter((order) => order.lineItems.some(lineItem => lineItem.categories.some(category =>category.id === item.id)));

but it isnt filtering and when I debug, i get the following error:

VM67561:1 Uncaught TypeError: Cannot read properties of undefined (reading 'some')

even though the nested arrays exist based on the above data. Is there something i am missing or a better way of approaching this.

before, i was filtering by item id which worked but I need to change to filter by category. How i filtered by item id was:

this.orders.filter((order) => order.lineItems.some(lineItem =>lineItem.item.id === item.id));

Jibrain Ltd want to employ african coders expecially nigerian because we are now located in Lagos Nigeria

Are you looking to improve or show your skills in coding be it frontend or backend programming now is the time, Jibrain ltd is ready to employ good coders in Lagos Nigeria, if you are from a neighboring country and you are looking to work in nigeria now is the time for you just submit your resume to [email protected] before feb 2 2024

DSA question is very hard pls try the qestion and answer is very soon

Given an array of integers and a target value, you must determine which two integers’ sum equals the target
and return a 2D array. Then merge the array into a single array with sorting ( ascending ) order, in the next
step double the target value and find again the combination of digits (can be multiple digits ) that are equal to
the double targeted value and returned into a 2D array.

Sample input: [1, 3, 2, 2, -4, -6, -2, 8];
Target Value = 4,
Solution output:First Combination For “4” : [ [1,3],[2,2],[-4,8],[-6,2] ];
Merge Into a single Array : [-6,-4,1,2,2,2,3,8];
Second Combination For “8” : [ [ 1,3,2,2], [8,-4,2,2],....,[n,n,n,n] ]

Woff file font not loading in Jquery terminal

Im trying to get my Jquery terminal have a custom font, in this case I have a woff file of it in my code editor, and Im trying to figure out how to get that font into jquery terminal. For the css, ive tried @font-face, but it doesnt work, same with .terminal and .terminal-output. I feel like it should work, but it doesnt, its still just the default monospace font in my code editor.

<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/jquery"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal/css/jquery.terminal.min.css"/>
</head>
    <style type="text/css">
        .terminal,
        span,
        .cmd,


        .terminal,
        span {
            --size: 1.15;
         font-family: 'Cascadia Code';
        }
     @font-face {
    font-family: 'Cascadia Code';
    src: url('CascadiaCode.woff2') format('woff2'),
        url('CascadiaCode.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
.terminal {
    font-family: 'Cascadia Code';
    src: url('CascadiaCode.woff2') format('woff2'),
        url('CascadiaCode.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


    </style>
<body>
    
    <script>
$('body').terminal({
    echo: function(...args) {
    this.echo(args.join(" "))
    }
}, {
checkArity: false,
    greetings: 'Terminal:'
});
</script>
</body>
</html>

How to show task pane for a JavaScript Excel AddIn on the right side instead of left?

I created an Excel AddIn following instructions from

https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=yeomangenerator

and I am able to use a so called task pane on the right side of the Excel 365 browser window.

How can I show the panel in Excel on the left side?

If that is not possible, how can I create a custom, docked task pane that is shown on the left? The dialog API only seems to support floating windows?

Related:

Setting width of Office add-in task pane

https://learn.microsoft.com/en-us/office/dev/add-ins/design/task-pane-add-ins

https://learn.microsoft.com/en-us/office/dev/add-ins/develop/dialog-api-in-office-add-ins

Screenshot

enter image description here

How to change font size of element in v-autocomplete?

Im trying to make the size of the elements title 1.7rem. I tried using template with v-bind but i cant effect the size. The only solotion i found is to use a template without the v-bind and give a custom title style, but then when clicking the list-item it wont trigger the v-autocomplete and select the item. I Need to find a way to eiter make the template clickable (adding @click doesnt make the menu close), or find a way to cahnge the style of elements. I also noticed that i coudnt edit the color of the icon without the borders if you know anything anout that as well.

this is with the template (not clicking / not updating and closing the menu)

<v-autocomplete
  v-model="countryCode"
  :items="countryCodeItems"
  variant="outlined"
>
  <template v-slot:item="{ item }">
    <v-list-item @click="selectCountryCode(item)">
      <v-list-item-title style="font-size: 1.7rem">{{
        item.title
      }}</v-list-item-title>
    </v-list-item>
  </template>
</v-autocomplete>

this is the items:

[{title: "USA (+710)", value: +710},
{title: "FRANCE (+640)", value: +640}
...
]

How do I get & and = to show up in html query

I need to generate the following
deviceSearch?q=4100&origin=pdp

instead I am seeing
deviceSearch?q=4100%26origin%3Dpdp

Googling this problem it seems I cannot do this.
I tried the following that did not work

    url.searchParams.set('q', item.selectionText);
    url.searchParams.append(name: origin, value: pdp);

I tried joining the text which did not work.

url.searchParams.set('q', item.selectionText.concat('&origin=pdp'));

I also tried using escape code ” before those characters. I assume I am missing something in addition to any real knowledge of javascript.

Minimax implementation in Js for TicTacToe wont work properly

I am making TicTacToe in html,css,js, all that good stuf. I made 2 gamemodes: 2 player, 1 player. The 2 player mode works just fine, but the 1 player mode is meant respond with the best move possible, I am trying to achieve that with the minimax algorithm, but it sometimes works (I guess by luck), sometimes doesn`t. The function bestMove() should change the variable AiMove to the index of the best square to move (the board/table is a 1d array). Also the checkWin() function returns a number between -1 and 1 (-1 – O/Ai wins; 0 – tie; 1 – X/Human wins). This is the code, please help.

function minimax(isMax){
    let winState = checkWin(), a=[], bestScore
    for(let i=0;i<table.length;i++)
        if(table[i]==0) 
            a.push(i)
    
    if(winState !=0 || a.lenght == 0)
        return winState;

    if(isMax == true){// Human - X - 1 - Max
        bestScore = -1024
        for(let i=0;i<a.length;i++){
            table[a[i]] = 1;
            let score =  minimax(false)
            table[a[i]] = 0
            bestScore = Math.max(bestScore, score)
        }
        return bestScore
    }
    else{//AI - O - -1 - Min
        bestScore = 1024
        for(let i=0;i<a.length;i++){
            table[a[i]] = -1;
            let score = minimax(true)
            table[a[i]] = 0
            bestScore = Math.min(bestScore, score)
        }
        return bestScore
    }

}

function bestMove(){
    let bestScore = 1024, potentialMove
    for(let i=0;i<table.lenght;i++)
        if(table[i] == 0){
            table[i] = -1
            let score = minimax(true)
            table[i] = 0
            if(score < bestScore){
                potentialMove = i;
                bestScore = score;
            }
        }

    AiMove = potentialMove;
}

I tried checking all the variables, I tried rewriting it, I watch a tutorial by the coding train and nothing. But also I wouldn’t rule out that I replace a variable with something else without me noticing or forgot to unde something.

There is an error with updateClock() and the timer that appears every time this function is called, every second

**First: I want that when adding a timer, it will appear once in the .container window and continue to work in it.
But updateClock is updated every second, and an update-adding occurs and a new timer appears – this should not be the case.

Second: You need to do this: When a new timer is added, it appears at the top, and the old one goes to the bottom.

That’s it. I will be extremely grateful for your help.**

<!DOCTYPE html>
<html>
<head>
  <style>
    /* Styling for the body */
    body {
      background-color: #33384C;
      color: white;
    }
    
    /* Styling for the notification */
    #notification {
      color: red;
      font-weight: bold;
    }
    
    /* Styling for text, date, and time inputs */
    input[type="text"], input[type="date"], input[type="time"] {
      width: 209.5px;
      box-sizing: border-box;
    }
    
    /* Styling for the "addTimerButton" */
    #addTimerButton {
      position: absolute;
      left: 0px;
      top: 0px;
      background-color: red;
      border-radius: 10px;
      width: 130px;
      height: 30px;
    }
    
    /* Styling for the "hideTimerButton" */
    #hideTimerButton {
      position: absolute;
      left: 100px;
      top: 0px;
    }
    
    /* Styling for the "timerName" input */
    #timerName {
      position: absolute;
      left: 0px;
      top: 21px;
    }
    
    /* Styling for the "date" input */
    #date {
      position: absolute;
      left: 0px;
      top: 40px;
    }
    
    /* Styling for the "time" input */
    #time {
      position: absolute;
      left: 0px;
      top: 59px;
    }
    
    /* Styling for the "targetDays" input */
    #targetDays {
      position: absolute;
      left: 0px;
      top: 80px;
    }
    
    /* Styling for the "startButton" */
    #startButton {
      position: absolute;
      left: 0px;
      top: 0px;
    }
    
    /* Styling for the "timerForm" */
    #timerForm {
      display: none;
    }
  </style>
</head>
<body>
  
  <button id="addTimerButton" type="button" onclick="addTimer()">Добавить таймер</button>

  <button id="hideTimerButton" type="button" onclick="hideTimer()">Скрыть таймер</button>
  
  <form id="timerForm">
    <!-- Input for timer name -->
    <input type="text" id="timerName" required><br>

    <!-- Input for date -->
    <input type="date" id="date" required><br>

    <!-- Input for time -->
    <input type="time" id="time" required><br>

    <!-- Input for target days -->
    <input type="text" id="targetDays" required><br>

    <!-- Button to start the countdown -->
    <button id="startButton" type="button" onclick="initializeClock()">Начать отсчет</button>
  </form>

  <script>
    // Function to add a timer
    function addTimer() {
      // Your code for adding a timer
      console.log('Таймер добавлен');
    }

    // Function to hide the timer
    function hideTimer() {
      // Your code for hiding the timer
    }

    // Function to initialize the countdown
    function initializeClock() {
      // Your code for initializing the countdown
    }
  </script>
</body>
</html>

  <div id="notification"></div>
  <div id="clock"></div>

  <script>
    var timeintervals = [];
    var clock = document.getElementById('clock');
    var notification = document.getElementById('notification');
    var targetDays = [];
    var countdownElements = [];

    function getTimeRemaining(endTime) {
      var totalMilliseconds = endTime - Date.now();
      var seconds = Math.floor((totalMilliseconds / 1000) % 60);
      var minutes = Math.floor((totalMilliseconds / 1000 / 60) % 60);
      var hours = Math.floor((totalMilliseconds / (1000 * 60 * 60)) % 24);
      var days = Math.floor(totalMilliseconds / (1000 * 60 * 60 * 24));

      return {
        'total': totalMilliseconds,
        'days': days,
        'hours': hours,
        'minutes': minutes,
        'seconds': seconds
      };
    }

    function addTimer() {
      var timerForm = document.getElementById('timerForm');
      timerForm.style.display = 'block';
      document.getElementById('addTimerButton').style.display = 'none';
      document.getElementById('hideTimerButton').style.display = 'inline-block';
    }

    function hideTimer() {
  var timerForm = document.getElementById('timerForm');
  timerForm.style.display = 'none';
  document.getElementById('addTimerButton').style.display = 'inline-block';
  document.getElementById('hideTimerButton').style.display = 'none';
}


    function initializeClock() {
      var inputDate = document.getElementById('date').value;
      var inputTime = document.getElementById('time').value;
      var targetDaysInput = document.getElementById('targetDays').value;
      targetDays = targetDaysInput.split(',').map(function (item) {
        return parseInt(item.trim(), 10);
      });

      for (var i = 0; i < targetDays.length; i++) {
        var endDate = inputDate + 'T' + inputTime + ':00';
        var endTime = new Date(endDate);
        endTime.setDate(endTime.getDate() + targetDays[i]);
        startCountdown(endTime);
      }
    }

    function startCountdown(endTime) {
      var countdownElement = document.createElement('div');
      countdownElements.unshift(countdownElement);
      clock.insertBefore(countdownElement, clock.firstChild);

      var timerName = document.getElementById('timerName').value;
      var startTime = new Date();
      var endTimeFormatted = formatDate(endTime);
      var startTimeFormatted = formatDate(startTime);

      function updateClock() {
  var timeRemaining = getTimeRemaining(endTime);
  var containerElement = document.querySelector('.container');

  var timerNameElement = document.createElement('div');
  timerNameElement.textContent = timerName + ' / ';
  containerElement.insertBefore(timerNameElement, containerElement.firstChild);

  var timeRemainingElement = document.createElement('div');
  timeRemainingElement.textContent = timeRemaining.days + ' дней, ' +
    timeRemaining.hours + ' часов, ' +
    timeRemaining.minutes + ' минут, ' +
    timeRemaining.seconds + ' секунд';
  containerElement.insertBefore(timeRemainingElement, containerElement.firstChild);

  var startTimeElement = document.createElement('div');
  startTimeElement.textContent = 'Начало: ' + startTimeFormatted;
  containerElement.insertBefore(startTimeElement, containerElement.firstChild);

  var countdownString = timeRemaining.days + ' дней, ' +
    timeRemaining.hours + ' часов, ' +
    timeRemaining.minutes + ' минут, ' +
    timeRemaining.seconds + ' секунд';

  var endDateTime = calculateEndDateTime(countdownString);
  var endFormatted = formatDate(endDateTime);

  var endFormattedElement = document.createElement('div');
  endFormattedElement.textContent = 'Окончание: ' + endFormatted;
  containerElement.insertBefore(endFormattedElement, containerElement.firstChild);

  if (timeRemaining.total <= 0) {
    var timerExpiredElement = document.createElement('div');
    timerExpiredElement.textContent = 'Таймер истек';
    containerElement.insertBefore(timerExpiredElement, containerElement.firstChild);

    notification.innerHTML = 'Уведомление!';
  } else {
    notification.innerHTML = '';
  }
}

function calculateEndDateTime(countdownString) {
  var currentDate = new Date();
  var remainingTimeParts = countdownString.split(', ');

  var days = 0;
  var hours = 0;
  var minutes = 0;
  var seconds = 0;

  for (var i = 0; i < remainingTimeParts.length; i++) {
  var part = remainingTimeParts[i];
  if (part.includes('дней')) {
    days = parseInt(part);
  } else if (part.includes('часов')) {
    hours = parseInt(part);
  } else if (part.includes('минут')) {
    minutes = parseInt(part);
  } else if (part.includes('секунд')) {
    seconds = parseInt(part);
  }
}
var container = document.querySelector('.container');

  var endDateTime = new Date(
    currentDate.getFullYear(),
    currentDate.getMonth(),
    currentDate.getDate() + days,
    currentDate.getHours() + hours,
    currentDate.getMinutes() + minutes,
    currentDate.getSeconds() + seconds
  );

  return endDateTime;
}

      updateClock();
      var timeinterval = setInterval(updateClock, 1000);
      timeintervals.push(timeinterval);
    }

    function formatDate(date) {
      var day = date.getDate().toString().padStart(2, '0');
      var month = (date.getMonth() + 1).toString().padStart(2, '0');
      var year = date.getFullYear().toString().padStart(4, '0');
      var hours = date.getHours().toString().padStart(2, '0');
      var minutes = date.getMinutes().toString().padStart(2, '0');
      var seconds = date.getSeconds().toString().padStart(2, '0');

      return day + '.' + month + '.' + year + ', ' + hours + ':' + minutes + ':' + seconds;
    }
  </script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
  <style>
    body {
      margin: 0;
      padding: 0;
    }

    #rectangle {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 50px;
      background: linear-gradient(to right, #833AB4, #FD1D1D, #FCAF45);
      background-size: 200% auto;
      animation: animatedGradient 10s linear infinite alternate;
      z-index: -3;
    }

    @keyframes animatedGradient {
      0% { background-position: 0% center; }
      100% { background-position: 100% center; }
    }
  </style>
</head>
<body>
  <div id="rectangle"></div>

  <!-- Place your content here -->

</body>
</html>

<!DOCTYPE html>
<html>
<head>
  <style>
    body {
      margin: 0;
      padding: 0;
      height: 100vh;
      background-color: #131722;
      font-family: Arial, sans-serif;
    }

    .timer-container {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
    }

    .timer {
      color: red;
      font-weight: bold;
      font-size: 30px;
    }
  </style>
</head>
<body>
  <div class="timer-container">
    <div class="timer" id="dateTime"></div>
  </div>

  <script>
    function getCurrentDateTime() {
      var currentDateTime = new Date();
      var day = currentDateTime.getDate().toString().padStart(2, '0');
      var month = (currentDateTime.getMonth() + 1).toString().padStart(2, '0');
      var year = currentDateTime.getFullYear().toString();
      var hours = currentDateTime.getHours().toString().padStart(2, '0');
      var minutes = currentDateTime.getMinutes().toString().padStart(2, '0');
      var seconds = currentDateTime.getSeconds().toString().padStart(2, '0');
      var milliseconds = currentDateTime.getMilliseconds().toString().padStart(3, '0');

      var dateTimeString = day + '.' + month + '.' + year + ' | ' + hours + ':' + minutes + ':' + seconds + ':' + milliseconds;

      return dateTimeString;
    }

    setInterval(function() {
      var dateTimeElement = document.getElementById('dateTime');
      dateTimeElement.textContent = getCurrentDateTime();
    }, 1); // Update every millisecond (1 millisecond)
  </script>
</body>
</html>

<!DOCTYPE html>
<html>

<head>
  <style>
    html,
    body {
      height: 100%;
      margin: 0;
      padding: 0;
    }

    .container {
      height: 500px;
      width: 500px;
      overflow-y: scroll;
      position: absolute;
      top: 100px;
      left: 50px;
    }


    .content {
      height: 100000px;
      /* здесь можно задать высоту содержимого */
      background-color: lightgray;
      padding: 20px;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="content">
      <!-- Ваше содержимое здесь -->
    </div>
  </div>
</body>
</html>

I don’t know what to do here at all.

Resolving “TypeError: Cannot read property ‘x’ of undefined” in JavaScript [closed]

  1. Clear and Descriptive Title:
    Make your title concise and specific to the issue you’re facing.
    Avoid generic titles like “Help me, please!” or “I have a problem.”
  2. Detailed Problem Description:
    Clearly explain the problem you’re facing.
    Provide relevant context about your project, programming language, and any frameworks/libraries in use.
    Include any error messages you’re encountering.
  3. Code Snippet:
    Share a minimal, complete, and verifiable example of your code.
    Trim down your code to the essential parts related to the issue.
    Use proper code formatting to make it readable.
  4. Expected and Actual Behavior:
    Explain what you expected your code to do.
    Describe the actual behavior you’re observing, including any error messages.
  5. What You’ve Tried:
    List the steps you’ve taken to troubleshoot or solve the problem.
    Mention any research you’ve done or resources you’ve consulted.
  6. Specific Question:
    Formulate a clear and specific question about the problem you’re facing.
    Avoid asking overly broad or vague questions.
    Make it clear what kind of help or solution you’re seeking.
  7. Additional Information:
    Provide any relevant details about your development environment, such as the version of the programming language you’re using.
    Mention any dependencies, frameworks, or libraries in your project.

Detailed Responses:

Expect responses that address the specific issues you’ve outlined in your question.
Users may offer explanations for the error you’re facing and provide solutions or suggestions to fix it.
Clarifying Questions:

Users may ask follow-up questions seeking additional details or clarification about your problem to better understand the context.
Alternative Solutions:

You may receive alternative approaches or solutions to your problem from different perspectives, providing you with a range of options.
Suggestions for Improvement:

Users might suggest improvements to your code structure or offer tips on best practices to help you avoid similar issues in the future.
Community Feedback:

Stack Overflow has a collaborative community, so expect feedback not only on your specific issue but also on coding style, best practices, and potential optimizations.
Learning Opportunities:

Your question and the responses you receive can be valuable learning opportunities, helping you understand the underlying concepts and improve your programming skills.
Timely Responses:

Depending on the complexity of your question and the visibility of the tags you’ve used, expect responses to come in varying time frames. Some questions get answered quickly, while others may take more time.
Courtesy and Professionalism:

The Stack Overflow community generally values professionalism and courtesy. Expect responses to be respectful and focused on helping you.

ERROR ReferenceError: WebSdk is not defined – digitalpersona

I’ve a problem with the digitalpersona sdk.

CrearempleadosComponent_Host.ngfactory.js:1  ERROR ReferenceError: WebSdk is not defined
    at new Channel (channel.js:10:1)
    at new FingerprintReader (reader.js:21:1)
    at CrearempleadosComponent.cargarLector (crearempleados.component.ts:557:19)
    at CrearempleadosComponent.ngOnInit (crearempleados.component.ts:97:10)
    at checkAndUpdateDirectiveInline (core.js:31910:1)
    at checkAndUpdateNodeInline (core.js:44367:1)
    at checkAndUpdateNode (core.js:44306:1)
    at debugCheckAndUpdateNode (core.js:45328:36)
    at debugCheckDirectivesFn (core.js:45271:1)
    at Object.eval [as updateDirectives] (CrearempleadosComponent_Host.ngfactory.js:1:1)

enter image description here

I’ve added the module/WebSdk forlder to the project, I’ve installed libraries. In another project it works, but now it’s working and I don’t know what to do