Javascript code to create comma separated list of all dates between (and including) two dates in YYYYMMDD format [duplicate]

I’m in Glide app and I have two dates that are in YYYYMMDD format; a check in date and check out date.

I need to create a comma separated list of all the dates in between and including those dates.

In Glide, when it uses Javascript, it uses p1, p2 for variables so p1 in the code would reference the column that is the check in date (in YYYYMMDD format) and p2 would so the same but for the check out date.

Would anyone be able to help me here? I’ve tried using chatGPT but I get zero output so I don’t know where it is going wrong.

So for example:

p1 = 20250916
p2 = 20250919

So the output should be

20250916, 20250917, 20250918, 20250919

HTML looking for a JavaScript file in the external script tag

I’m writing an index.html with an external script tag to my js file but I don’t think it sees my file. I’ve tried including the path from root and just the file name neither show my js scripts when I view my html.

HTML

<script src="Develop/JavaScript/shapes.js"></script>

And

<script src="shapes.js"></script>

JS

ellipse(200, 200, 240, 300);

I’ve put both my HTML and my JavaScript in the same folder but still don’t see my js running the index.html whatever path I am using but I still think it’s the wrong directory it’s looking for is my hunch.

Razorpay UI not opening on iOS device

I’m integrating Razorpay in my React Native project using:

react-native-razorpay: ^2.3.0

CocoaPods versions tried: 1.4.0, 1.4.3, 1.4.5

The issue is:

On Android, the Razorpay checkout UI (payment webview) opens and works correctly.

On iOS, the payment UI does not open at all.

Steps I already tried:

Verified that all Razorpay credentials (key ID, order ID, amount, etc.) are correct.

Passed the required options object correctly to the RazorpayCheckout.open(options) function.

Re-installed pods and cleaned the iOS build (pod install, pod update, npx pod-install, xcode clean build).

Tested on both simulator and real device (same issue).

Here’s a sample of the code I am using:

import RazorpayCheckout from ‘react-native-razorpay’;

const openRazorpay = () => {
const options = {
description: ‘Test Payment’,
image: ‘https://your-logo-url.png’,
currency: ‘INR’,
key: ‘my key’,
amount: ‘5000’, // 50 INR
name: ‘Test Merchant’,
order_id: ‘my order id’, // generated from backend
prefill: {
email: ‘[email protected]’,
contact: ‘9999999999’,
name: ‘Test User’,
},
theme: {color: ‘#53a20e’},
};

RazorpayCheckout.open(options)
.then(data => {
    console.log('Payment success:', data);
})
.catch(error => {
    console.log('Payment failed:', error);
});

};

Since the same code works fine on Android, I believe the issue is iOS-specific.

Question:
Has anyone faced this issue where the Razorpay checkout UI does not open on iOS? Do I need any additional setup or configuration in Xcode / Info.plist for iOS?

Performance drop drawing hundreds of shapes at once

I am creating a visualizer for a project. I extended the konva.group class and created whst i call a “location”.
Each location consists on 2 concentric circles and a lable and I need it to be clickable.
Locations are created from an array of objects each containing parameters that defines it like: internal diameter, external diameter, internal color, external color and idx(label).
For reference drawing 400 locations takes around 3 seconds.
After the initial draw I only create “new” locations if the array increases and update existing shapes lowering unpdates to milliseconds.
Any suggestions on ways of improving performance?

I tryed caching but without mutch luck, possibly due to me not implementing it correctly.

PWA para controle de estoque e vendas [closed]

desenvolvi um app para controlar o estoque e as vendas de uma adega ou varias, iniciei o codigo em html/css e javascript, dei continuidade com o gpt e agora não consigo continuar e o gpt so piora o que tento consertar, alguem pode me ajudar com os codigos ?

tentei ajuda com o gpt mais sem sucesso e so frustração

How to add a second CSS property (color change) to a transform animation using classList.toggle?

I’m working on a simple project where I want to animate a div element. I’m trying to make a white box both move to the right and change color when it’s clicked. I’m using a JavaScript click event to toggle a CSS class.

The problem is that my code only makes the box move, but it does not change its color. I have a transition: all property on the box, so I expected it to animate both properties.

Here is my code:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Animation Problem</title>
    <style>
        body {
            display: flex;
            justify-content: center;
        }
        #container {
            height: 130px;
            width: 350px;
            background: linear-gradient(to right, red, blue);
            display: flex;
            align-items: center;
            border-radius: 100px;
        }
        #box {
            height: 100px;
            width: 100px;
            background-color: #edeaea;
            margin-left: 15px;
            cursor: pointer;
            border-radius: 50%;
            transition: all 1s ease-in-out;
        }
        .clicked-box {
            transform: translateX(220px);
        }
    </style>
</head>
<body>
    <div id="container">
        <div id="box"></div>
    </div>
    <script>
        let box = document.querySelector("#box");
        box.addEventListener("click", function(){
            box.classList.toggle('clicked-box');
        });
    </script>
</body>
</html>```




I have tried adding background-color: blue; to the .clicked-box class, but it still doesn't seem to work, and I'm not sure if I'm missing a property or using the transition incorrectly.

How can I get the box to both move and change color smoothly when it's clicked?

`your text`

Babel plugin to add function keyword [closed]

Is there a Babel plugin or equivalent that could re-add the function keyword in front of a prototype function declaration, while still generating ES5?

Input:

myObject.prototype = { myMethod() { console.log("whatever"); } };

Into:

myObject.prototype = { myMethod: function() { console.log("whatever");} };

why the log on the post shows, tried to fix but no success

I am trying to deploy a project on Vercel and the error on the log shows, can anyone assist me?

2025-09-15T12:51:38.681Z [error] Error: ENOENT: no such file or directory, mkdir '/var/task/uploads'

at Object.mkdirSync (node:fs:1364:26)
at Object.<anonymous> (/var/task/server.js:46:6)
at Module.<anonymous> (/opt/rust/bytecode.js:2:1435)
at A.l._compile (/opt/rust/bytecode.js:2:3160)
at Object..js (node:internal/modules/cjs/loader:1895:10)
at Module.load (node:internal/modules/cjs/loader:1465:32)
at Function.<anonymous> (node:internal/modules/cjs/loader:1282:12)
at /opt/rust/nodejs.js:2:13528
at Function.Br (/opt/rust/nodejs.js:2:13906)
at Le.e.<computed>.De._load (/opt/rust/nodejs.js:2:13498) {
errno: -2,
code: 'ENOENT',
syscall: 'mkdir',
path: '/var/task/uploads'
}
Node.js process exited with exit status: 1. 

Multi EVM Gateway [closed]

I have 3 EVM Nodes, Eth Main, Base, and Arbitrum, my goal is to connect them all to one gateway and have API’s and Websockets be able to pull information from all 3 through 1 endpoint. will the different costs in gas fees be the downfall of this? Most likely it is my lack of foundational understanding that is causing this issue. I have the nodes, I have the gateway built I just can’t get all the information through a single point it is still connecting to each individual node.

I am using Google Cloud with VM instances and Compute engine with Ethereum nodes for the setup and coding with js. I have also been told this is an ambitious project for a beginner but I am mostly setup and getting information from each node it is just connecting them together and getting the information for all 3 through 1 endpoint that I am struggling with.

Detect if “message” event ran inside iframe came from my Chrome extension or from a page script (and block the latter)

I’m building an extension whose content script injects an iframe with my content into a page, extending its functionality, while not being interfered by a page.

The content script needs to send some data it extracts on the page to the iframe.
I want to use postMessage and onmessage for this, like so:

Content script:

let div = document.createElement('div');
let iframe = document.createElement('iframe');
iframe.src = chrome.runtime.getURL("page.html");
div.appendChild(iframe);
document.getElementById("main").appendChild(div);
iframe.onload = function(){
    iframe.contentWindow.postMessage(itemList, "*"); 
}

Script inside page.html, the injected iframe:

let list;
window.addEventListener('message', function(event) {
    list = event.data;
}

This setup works, but the problem is that the callback for the “message” event runs more than once, and I only call postMessage once in my content script. This leads me to believe, that my iframe detects postMessage sent from the page scripts.

I tried looking at event.origin but it is the same as the document host (example.org), so that can’t be detected.

A workaround to detect which is which would be sending my data in a more specific format as currently I send an just array (adding some from: myAwesomeExtension property), but I would prefer filtering the “noise” altogether, as this has the risk of forgery and a potential security issue as well.

Another, more common approach is sending the data from the content script to the iframe through the background script (content -> background -> iframe) with browser extension APIs, but that feels clumsy.

I’m interested in cross browser support, so Chrome as well as Firefox.

Cannot export function from plain js module without export default

I am trying to export like this :

export function play(a){
  console.log(a)
}

And importing like this :

import { play } from "../../audio.js";

In browser console getting this error :

Uncaught SyntaxError: The requested module ‘http://localhost:5173/audio.js?t=1757949216309’ doesn’t provide an export named: ‘default’

But when I export default like this :

export default function play(a){
  console.log(a)
}

import

import play  from "../../audio.js";

it works fine.
How can I export without default?

Module.findExportByName doesn’t compile [duplicate]

I installed Frida 17.2.17:

python -m pip install frida-tools

and to hook setsockopt Win API function I generated the following script with AI:

function readOptVal(optvalPtr, optlen) {
    return "<not implemented>";
}

var fn = Module.findExportByName("ws2_32.dll", "setsockopt");

if (!fn)
{
    console.log("setsockopt not found!");
}
else
{
    Interceptor.attach(fn, {
        onEnter: function(args) {
            var sock = args[0].toInt32();
            var level = args[1].toInt32();
            var optname = args[2].toInt32();
            var optval = args[3];
            var optlen = args[4];

            var val = readOptVal(optval, optlen);

            console.log("[setsockopt] called");
            console.log("  Socket:", sock);
            console.log("  Level :", level);
            console.log("  Opt   :", optname);
            console.log("  Val   :", val);
            console.log("  Len   :", optlen.toInt32());
        },
        onLeave: function(retval) {
            console.log("  Return:", retval.toInt32());
            console.log("------------------------------------");
        }
    });
}

and tried the following command:

frida -p 351768 -l hook_setsockopt.js

but got the following error:

TypeError: not a function
    at <eval> (C:devworkhook_setsockopt.js:5)

line 5 is:

var fn = Module.findExportByName("ws2_32.dll", "setsockopt");   

what is wrong with it?

How to add a custom search/filter function for DataTables’ searchList using Vue templates?

I am trying to create a Vue DataTable component so I can make several tables without having to worry about their overall set-up (since it will be done in this main table component).

One of the features I want is for the columns that use searchList (similar to the MultiSelect column in Notion) to recognize cells that have a list of values (here described as “tags”). I need the search function to recognize that, if the cell content is a list, then each individual item in that list may be searched and accounted for when it comes to filtering.

For that, I believe I need to modify the columns.search API so that, for each column it applies to, it:

  1. Parses each cell into a list
  2. Tries to match the items in the list of point #1 to the selected tags in the column’s searchList.
  3. Returns true if a single item matches

However, I am using Vue and not the “default” DataTables; and I am using Vue as a child component, not as the parent one. The reference documentation says I need to use the dt() method to access the API that should allow me to modify columns.search(). I have seen the example of how to do so for a predefined column with a predefined search query (here, with numbers), but I am stuck on how to do so for a general case scenario (again, the Vue component is meant as a template for any table I may want to add).

How do I obtain the searchlist selected items when I don’t know what information each column will contain yet? How do I do the same for each cell?

So far, I’ve managed to parse each item for display, but not for filtering.
Sample code and result below

Step 1: Display with no filtering yet
Tag selection - default

Step 2: Display with Tag A selected (Tag A Tag B and Tag C count as a single value to searchList – Not intended)
Tag selection - Tag A selected, Tag A Tag B and Tag C count as a single value

Step 3: with Tag A selected, the item with tags A B and C does not appear
Tag selection - Tag A selected, item with tags A B and C does not appear

Code on main.js:

import './assets/css/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import '@fortawesome/fontawesome-free/js/all'

const app = createApp(App)

app.use(router)

app.mount('#app')

Code on App.vue:

<script setup>
import { RouterView } from 'vue-router'

import Sidebar from './components/sidebar/Sidebar.vue';
import {sidebarWidth} from './components/sidebar/sidebar-state.js';
</script>

<template>
  <Sidebar />
  <div :style="{'margin-left': sidebarWidth}">
    <RouterView />
  </div>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>

Code on Table.vue:

<script setup>
import jquery from 'jquery';
import DataTable from 'datatables.net-vue3';
import DataTablesLib from 'datatables.net-dt';
import 'datatables.net-colreorder-dt';
import 'datatables.net-columncontrol-dt';
import 'datatables.net-fixedheader-dt';
import 'datatables.net-fixedcolumns-dt';
import 'datatables.net-responsive-dt';
import 'datatables.net-searchpanes-dt';
 
DataTable.use(DataTablesLib);

const props = defineProps({
  columns: {
    default: [
      {data: 'id', title: 'PersonId',},
      {data: 'name', title: 'PersonName',},
    ]
  },
  options: {
    default: {
      responsive: true,
      scrollX: true,
      fixedHeader: true,
      fixedColums: true,
      colReorder: true,
      paging: false,
      scrollY: 300,
      scrollCollapse: true,
      columnControl: ['order', ['searchList']],
      ordering: {
        indicators: false
      }
    }
  },
  data: {
    default: [
      {name:'RowItem1ValueA', id:'RowItem1ValueB'},
      {name:'RowItem2ValueA', id:'RowItem2ValueB'},
    ]
  }
})

</script>

<template>
  <DataTable :columns="props.columns" :options="props.options" :data="props.data" 
  class="display compact">
  </DataTable>
</template>

<style>
@import 'datatables.net-dt';
@import 'datatables.net-responsive-dt';
@import 'datatables.net-fixedheader-dt';
@import 'datatables.net-fixedcolumns-dt';
@import 'datatables.net-colreorder-dt';
@import 'datatables.net-columncontrol-dt';
@import 'datatables.net-searchpanes-dt';
</style>

<style scoped>
th, td { white-space: nowrap; }

td.multiples{
  white-space: pre-wrap;  
}

div.dataTables_wrapper {
    margin: 0 auto;
}

div.container {
    width: 80%;
}
</style>

Code on OrganizationView.vue (view where I’m trying to use the default table as a template for “random” data):

<script setup>
import Table from '../components/table/Table.vue'

const tableInfoPeople = {
  'Columns': [
    {data: 'dtPerson', title: 'Person',},
    {
      data: 'dtTags', 
      title: 'MultiTags', 
      render: {
          _: '[, ].id',
          sp: '[].id'
      }
    },
  ],
  'Data': [
    { dtPerson: 'Name01',
      dtTags: [
        {'id': 'TagA'}
      ],
    },
    { dtPerson: 'Name02',
      dtTags: [
        {'id': 'TagA'}, {'id': 'TagB'}, {'id': 'TagC'}
      ],
    },
    {
      dtPerson: 'Name03',
      dtTags: [{'id': 'TagD'}],
    },
    
  ] 
}
</script>

<template>
  <Table :columns="tableInfoPeople.Columns" :data="tableInfoPeople.Data">
  </Table>
</template>

I appreciate any help you might give me.

Note: I know the css doesn’t look great, I wanted to change it after fixing the functionality.

addEventListener applies to all buttons

In my HTML, there are 7 buttons. I have created the following JavaScript with the intent that each time a button is pressed, the alert is called. However, how it actually operates is that once the first button is pressed the alert appears 7 times, each alert appearing once the previous has been dismissed. I was expecting this function to apply the EventListener to each button separately.

let buttons = document.querySelectorAll("button");

buttons.forEach(myFunction);

function myFunction(){
    addEventListener("click", function() {
        alert("I got clicked!");
    });
};