JS FullCalendar Recurring Event not having correct start time

first time posting here. I am using Javascript FullCalendar and I am trying to set up a simple recurring event. The problem is that its start time is not displayed correctly and the event itself is not appearing in the Week/Day View(I am assuming it’s because the start/end times are not being rendered correctly.) The recurring event is the one with title – Mathemathics. As show in the pictures, it displays a time of 12:00:00 which is incorrect as in the code I clearly set it to 16:00. It can be seen in the month view but in week and day it’s not showing up. Any tips and suggestions will be helpful, looked up all over the internet and the FullCalendar docs but couldn’t find anything related to my problem.

document.addEventListener('DOMContentLoaded', function() {
                var calendarEl = document.getElementById('calendar');
                var calendar = new FullCalendar.Calendar(calendarEl, {
                    initialView: 'dayGridMonth',
                    height: "90%",
                    slotMinTime: "06:00:00",
                    slotMaxTime: "20:30:00",
                    firstDay: 1,
                    eventTimeFormat: {
                        hour: '2-digit',
                        minute: '2-digit',
                        second: '2-digit',
                        meridiem: false
                    },
                    slotLabelFormat: {
                        hour: '2-digit',
                        minute: '2-digit',
                        meridiem: false,
                        hour12: false
                    },
                    headerToolbar: {
                        left: 'prev,next today',
                        center: 'title',
                        right: 'dayGridMonth,timeGridWeek,timeGridDay'
                        },
                    events: [{
                        title: 'Mathematics',
                        starTime: '16:00:00',
                        endTime: '17:30:00',
                        daysOfWeek: [1]
                    }, {
                        title: 'C++',
                        start: "2021-12-11T10:00:00",
                        end: "2021-12-11T12:00:00",
                    }]
                    });
                calendar.render();
            });

Month view

Week view

EDIT:
I am using FullCalendar v5.10.1

Bug in my recursive division algorithm (to generate maze randomly)

I’m having trouble generating a random maze. My algorithm creates the initial box where the maze will be. But I cannot seem to generate any walls inside of this box. I’m trying to use the recursive division algorithm. Here is my code:

class Maze {
    constructor(COLS,ROWS) {
        this.width = COLS;
        this.height = ROWS;
        this.COLS = this.width*2+1; // *2 To account for blocks which are replaced by walls, 
        this.ROWS = this.height*2+1; // so the hollow blocks will be half of the total blocks, and there 
        //will be +1 wall (because the border of the maze will be a wall on either side on both x and y axies.)
        this.dimentions = [this.COLS, this.ROWS];
        this.maze = this.initArray([]);

        // This will palce the border walls (the ones on the outside of the maze)
        this.maze.forEach((currentRow, index) => {
            if(index === 0 || index === this.ROWS-1) {
                currentRow.forEach((_, cellIndex) => {
                    this.maze[index][cellIndex] = ["BLACK_WALL"];
                });
            } else {
                this.maze[index][0] = ["BLACK_WALL"];
                this.maze[index][currentRow.length-1] = ["BLACK_WALL"];
            }
        });

        // Now do the "recursive division" method to generate the maze
        const randomWallStart = [[2,2], [this.COLS-3, this.ROWS-3]][this.randInt(0,2)]; // Picks top left or bottom right
        const randomWallEnd = [[this.COLS-3, 2], [2, this.ROWS-3]][this.randInt(0,2)]; // Picks the other corner
        this.recursiveDivision(randomWallStart, randomWallEnd);
    }

    randInt(min, max) { // Used in random generation of maze
        return Math.floor(Math.random()*(max-min))+min;
    }

    initArray(value) {
        return new Array(this.ROWS).fill().map(() => new Array(this.COLS).fill(value));
    }

    recursiveDivision(wallStart, wallEnd, its=0) {
        this.maze[wallStart[1]][wallStart[0]] = ["FLAG1"];
        this.maze[wallEnd[1]][wallEnd[0]] = ["FLAG2"];
        const randXpoint = this.randInt(wallStart[0], wallEnd[0]); // Doesn't matter which way round the max and min are.
        const randYpoint = this.randInt(wallStart[1], wallEnd[1]);

        const directionToBuildWall = wallStart[0] === wallEnd[0] ? 0 : 1; // 0 = x-axis 1 = y-axis

        const newWallStart = [randXpoint, randYpoint];
        let forwardsOrBackwards = 1;
        if(newWallStart[directionToBuildWall] > this.dimentions[directionToBuildWall]/2) {
            forwardsOrBackwards = -1;
        }

        let currentPosition = newWallStart;
        currentPosition[directionToBuildWall] +=  forwardsOrBackwards * 1;

        while(this.maze[currentPosition[1]][currentPosition[0]] != "BLACK_WALL") {
            this.maze[currentPosition[1]][currentPosition[0]] = ["BLACK_WALL"];
            currentPosition[directionToBuildWall] += forwardsOrBackwards*1;
        }

        if(its > Math.min(this.COLS-2)) {
            return;
        }
        const beginningPos = currentPosition.slice();
        beginningPos[directionToBuildWall] = 1; 
        this.recursiveDivision(currentPosition,beginningPos,its+1);

    }

  posToSpace(x) {
    return 2 * (x-1) + 1;
  }

  posToWall(x) {
    return 2 * x;
  }

  inBounds(r, c) {
    if((typeof this.maze[r] == "undefined") || (typeof this.maze[r][c] == "undefined")) {
      return false; // out of bounds
    }
    return true;
  }

  isGap(...cells) {
    return cells.every((array) => {
      let row, col;
      [row, col] = array;
      if(this.maze[row][col].length > 0) {
        if(!this.maze[row][col].includes("door")) {
          return false;
        }
      }
      return true;
    });
  }

  countSteps(array, r, c, val, stop) {

    if(!this.inBounds(r, c)) {
      return false; // out of bounds
    }

    if(array[r][c] <= val) {
      return false; // shorter route already mapped
    }

    if(!this.isGap([r, c])) {
      return false; // not traversable
    }

    array[r][c] = val;

    if(this.maze[r][c].includes(stop)) {
      return true; // reached destination
    }

    this.countSteps(array, r-1, c, val+1, stop);
    this.countSteps(array, r, c+1, val+1, stop);
    this.countSteps(array, r+1, c, val+1, stop);
    this.countSteps(array, r, c-1, val+1, stop);
  }

  display() {
    this.parentDiv = document.getElementById("maze-container");
    while(this.parentDiv.firstChild) {
      this.parentDiv.removeChild(this.parentDiv.firstChild);
    }
    const container = document.createElement("div");
    container.id = "maze";
    container.dataset.steps = this.totalSteps;

    this.maze.forEach((row) => {
      let rowDiv = document.createElement("div");
      row.forEach((cell) => {
        let cellDiv = document.createElement("div");
        if(cell?.join) {
          cellDiv.className = cell.join("");
        }
        rowDiv.appendChild(cellDiv);
      });
      container.appendChild(rowDiv);
    });

    this.parentDiv.appendChild(container);

    return true;
  }
}

const myMaze = new Maze(5,5);
myMaze.display();
body, html {margin: 0;}
#maze-container {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

#maze {
  position: relative;
  background-color: #a7c53f;
  background-size: 8em 8em;
}
#maze div {
  display: flex;
}
#maze div div {
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
}
#maze div div::after {
  position: absolute;
  left: -3px;
  top: -4px;
  text-align: center;
  text-shadow: 0 0 1px black;
  font-size: 1.2em;
  z-index: 10;
}
.FLAG1 {
    background-color: #a00;
}
.FLAG2 {
    background-color: #0a0;
}
#maze div div.BLACK_WALL, #maze div div.nubbin.BLACK_WALL, #maze div div.door.exit {
  background-color: #000;
  background-size: 0.5em 0.5em;
}
#maze div div.nubbin.BLACK_WALL::after {
  content: "";
}
#maze div div:nth-child(odd) {
  width: 1em;
}
#maze div:nth-child(odd) div {
  height: 1em;
}
<div id="maze-container"></div>

As you can see when you run the code, the walls are generated, but in the wrong places. So some touch each other (so you can’t move between them) and I cannot solve this problem.
I cannot get this “recursive division” algorithm to work properly.

show pop-up component when the user refresh the page from browser in Vue.js

I am working on a project. I have a create product page. When user fill out one of input boxes and decide to click another menu i can catch the click event beforeRouteLeave hooks and trigger the “page leaving warning pop up component”.

On the other hand I need to trigger that pop up again when user click browser’s page refresh button. How can I do that?
I have tried so many events such as “beforeonload onunload unload” so far. I can get default warning pop up that comes from browser and I could not override it.

I tried many times but without success. Anyone guide me?

Uncaught SyntaxError: Unexpected end of input false error [closed]

Just The last “}” shows a error for no reason.
A “}” is a death?
VIIIth attempt.
A coding job makes my brain kinda melt.
Send help! I am freaking out!
Can’t fix this.
Return 1;
I am almost losing my mind.
Pot of 1 and 0s’.
Thanks if you read this btw just read the first letter on the first words on start of the sentences.

console.error("1010101 011110 1010101010 1001 0101010100 1001 010001001");
function makeid(length) {
   var result           = '';
   var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';   
   var charactersLength = characters.length;
   for ( var i = 0; i < length; i++ ) {
     result += characters.charAt(Math.floor(Math.random() * charactersLength));
   }
  return result;
  console.log(makeid(29));
}

document.getElementById("submit").onclick = function() {
 console.log("Submitted prize. Prize ID:");
  function makeid(length) {
    var result           = '';
    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var charactersLength = characters.length;
    for ( var i = 0; i < length; i++ ) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
   }
   return result;
   console.log(makeid(27));
}
  
document.getElementById("acceptpol").onclick = function() {
  console.log("Accepted promise. Promise ID:");
  function makeid(length) {
    var result           = '';
    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var charactersLength = characters.length;
    for ( var i = 0; i < length; i++ ) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
   }
   return result;
   console.log(makeid(29));
}
function makeid(length) {
    var result           = '';
    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var charactersLength = characters.length;
    for ( var i = 0; i < length; i++ ) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
    }
   return result;
   console.log(makeid(11));
}
h1{
 color: green;
}
label{
 color: green;
}
input{
 color: green;
}
body,html{
 height: 100%;
 margin: 0;
 background-image: url('smile.jpg');
 background-position: center;
 background-size: cover;
 
}
<html>
 <body>
  <h1> Press F12 in your keyboard to see your promise, submit and your contact ID </h1>
  <h1> ENTER YOUR INFORMATION TO CLAIM YOUR PRIZE! </h1>
   <label for="fname">First name:</label>
   <input type="text" id="fname" name="fname"><br><br>
   <label for="lname" id="lname">Last name:</label>
   <input type="text" id="lname" name="lname"><br><br>
   <label for="emailadd">E-Mail Address (So we can contact to you):</label>
   <input type="text" id="emailadd" name="emailadd"><br><br>
   <label for="address">Your Home Address</label>
   <input type="text" id="address" name="address"><br><br>
   <input type="checkbox" id="acceptpol">accept to contact to us when your prize when it's not in your address</input> 
   <input id="submit" type="submit" value="Submit"></input>
 </body>
 <head>
  <title> TriviaAwards.com </title>
  <link rel="stylesheet" href="style.css">
  <script src="script.js"></script>
 </head>
</html>

Presenting large sets of options

I’m going to build a website where the user will have to make selections from three large set’s of options. There’s about 300 options for each selection. What’s a good way of presenting that? I was thinking about sideways scrolling select boxes but I can’t find any examples of that.

Thanks!

Cant handle error in Google cloud function when FCM token is not valid

I try to match to handle this error of this function, I want to continue to execute all remaining code even if user FCM is not vailed.

try {
      admin.messaging().send(fcmToOwnerBody,).catch((e)=>{
         console.log("1* owner fcm token in invaild: " +e );
        });
         } catch (err) {
              console.log("1 owner fcm token in invaild: " +err );
      }

This the error of Function from logs

Error: The registration token is not a valid FCM registration token
at FirebaseMessagingError.FirebaseError [as constructor] (/workspace/node_modules/firebase-admin/lib/utils/error.js:44:28)
at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/workspace/node_modules/firebase-admin/lib/utils/error.js:90:28)
at new FirebaseMessagingError (/workspace/node_modules/firebase-admin/lib/utils/error.js:279:16)
at Function.FirebaseMessagingError.fromServerError (/workspace/node_modules/firebase-admin/lib/utils/error.js:312:16)
at Object.createFirebaseError (/workspace/node_modules/firebase-admin/lib/messaging/messaging-errors-internal.js:35:47)
at /workspace/node_modules/firebase-admin/lib/messaging/messaging-api-request-internal.js:79:51
at processTicksAndRejections (internal/process/task_queues.js:95:5) 

The function carsh and response with [firebase_functions/internal]

Calling code from a single Javascript file instead of calling intepedent Javascript files

I use a cookie consent policy banner from https://www.freeprivacypolicy.com which calls JS script files according the category they belong.

Fore example:
<script type="text/plain" cookie-consent="tracking" src="google-analytics.js"></script>
is called when users enable tracking cookies and
<script type="text/plain" cookie-consent="targeting" src="google-adsense.js"></script>
is called when users enable targeting cookies related to advertisement.

Is it possible to put all the relevant Javascript code in one file and instead of calling certain files according to the users’ preferences to call the relevant functions in their place? Or is using separate files the only possible way of implementation?

Generate Json UI Schema from a Json schema

I have a configuration repository made of different object (configuration). For each of them i know structure and field domains, so i have build a json schema for all my configuration (in the repository) based on the configuration “type” structure.

I am trying to use project like this to achive te json-schema to form conversion :
https://github.com/jarvelov/vue-form-json-schema

But in order to do so i also have to produce a UI Schema, and i don’t know how to generate such information in authomatic way.
I can build my own Json Schema converter/parser studying UI Schema definition first, but that seems very time consuming.

So i wondering if there is a better approach to my problem (assist configuration data-entry when you don’t know configuration structure in advance), or if there is a standard way to convert Json Schema to UI Schema.

Ps : Here what i mean for UI Schema
https://jsonforms.io/examples/gen-uischema/

How I could test location with MemoryRouter on React Router DOM v6?

Using React Router DOM (v6) with React Testing Library, I would like to know if there’s a way to deal with “mocked” history from createMemoryHistoryor an alternative like it.

Based on the example of Testing Library, I could mock the history on the Router component but in v6 this component doesn’t accept the history prop anymore.

So, my doubt is: how can I test history and location with RTL (React Testing Library) with React Router DOM v6? Should I keep using the MemoryRouter?

How to bind text to the label which is in JsonObj using jquery

I am getting data in an array which I need to bind to the label below is my code. When the array is empty I need to bind no records found which are working but I need to bind the data in the array to the label. Suppose if I have 2 items in the array I need to bind two items i.e slider 1 should have one item and again after sliding to the right I need to bind the second item.

If more than 1 item is there then the right slider should be enabled and if it has only 1 item right slider should be disabled if there are no items both the sliders should be disabled

enter image description here

enter image description here

success: function (response) {
                    var json = response.d;
                    if (json.length == 0) {
                        $('.swiper-wrapper').append('<div class="swiper-slide">No rocords found</div>');
                    } else {
                        $.each(json, function (index, item) {
                            $('.swiper-wrapper').append('<div class="swiper-slide">Name : ' + item.Name + '<br />Number: ' + item.Number + '</div>');
                        });
                    }

Why when I create several html tags with javascript then I can not delete it with the same javascript?

When I create a form with the write () command, then I want to delete it, but I can’t. What is the cause of this problem?

In order to do this correctly, what command should I use or what should I change in my code?

var btn = document.querySelector('#btn');
var btn_alert = document.querySelector('#btn-alert');
var content = document.querySelector('.popup-container');
var div1 = document.getElementById('div1');

function message(message, btn) {
    document.write('<div id="div1"><div id="content" class="popup-container"><div class="box-item"><div class="icon-success"><span class="span1"></span> <span class="span2"></span><div class="ring"></div></div><h2 class="alert-title">Good job!</h2><div class="alert-content">' + message + '</div><div class="actions-btn"><button onclick="ok()" class="btn-alert" id="btn-alert">' + btn + '</button></div></div></div></div>')
}

function ok() {
    div1.removeChild(content);
}
<button class="btn-alert" id="btn">OK</button>

    <!-- <div id="content" class="popup-container dis-active">
        <div class="box-item">
        <div class="icon-success">
            <span class="span1"></span> 
            <span class="span2"></span>
            <div class="ring"></div>
        </div>
        <h2 class="alert-title">Good job!</h2>
        <div class="alert-content">is ok.</div>
        <div class="actions-btn">
        <button class="btn-alert" id="btn-alert">OK</button>
        </div>
        </div>
    </div>  -->

    
    <script src="script.js"></script>
    <script>
        message("خوش اومدی!", "کلیک کن");
    </script>