Posts by Teuuz1994 • 131 points
15 posts
-
1
votes2
answers72
viewsA: Problem using push in JS array
you can use the momentjs library that is great in these cases and to solve your array you can do the following: library link: https://momentjs.com/ const newData = data.map(index => { return…
-
0
votes1
answer78
viewsA: Engine EJS + Javascript, sharing variables
For ejs to have access, have you ever tried to "export" the object inside render? ex.: res.render('/nome_da_rota', { objeto aqui }); And to redirect to any other route just type:…
-
0
votes1
answer48
viewsA: Asynchronous function return
I’ll try to help you try to do it this way: const { Sequelize, sequelize } = require('../../config/database'); // Classe para realizar manipulação dos usuarios no banco function pesquisa() { class…
javascriptanswered Teuuz1994 131 -
1
votes1
answer157
viewsA: Native Javascript date formatting does not work
Maybe this will help you: var data = new Date(); data.toLocaleDateString('pt-br'); var hora = data.getHours(); var minuto = data.getMinutes(); var segundos = data.getSeconds(); var dia =…
javascriptanswered Teuuz1994 131 -
0
votes2
answers890
viewsA: Modal bootstrap does not appear when clicking button
Your bootstrap.js import line is incorrect friend, try to put so: <script src="./DataTables/DataTables-1.10.16/js/bootstrap.min.js"/> another error that is happening is that this import is…
-
-1
votes1
answer35
viewsQ: Problems with Promisse: Promisse[Object]
I’m developing an application and I’m doing database queries with a predefined model, I’m trying to use an asynchronous function to store the value of this query in a variable. Below follows the…
-
-2
votes1
answer58
viewsQ: how to pass multiple database queries to a route?
Problem: I am developing an application in Nodejs + Express and I have reached a stage where I need to pass several queries to the database by a single route. NOTE: I use the Sequelize ORM to…
-
1
votes1
answer404
viewsA: Error creating a table with sequelize "Typeerror: Cannot read Property 'sequelize' of Undefined"
I think I found where your problem is, I also suffered a lot when going to use Sequelize and not Mongoose, your error is in the file db.js, ali vc need to import 2 instances of sequelize when I set…
-
1
votes1
answer145
viewsA: Change the css of an element by id
From what I see, you are trying to implement css in a jquery, which is not necessary and I advise you to use a separate project style sheet for better organization of your code. Possible solutions:…
-
0
votes1
answer48
viewsA: How does an image adapt to the placement of an element in css?
Problem solving: I solved the problem by putting the property position: sticky;in the images with this they accompanied at all times its parent element that was the div, I made some modifications to…
-
-2
votes1
answer48
viewsQ: How does an image adapt to the placement of an element in css?
I’m building a project and I had to use css, which by the way is not my strong suit, and I came across the following situation, the site needs to be responsive, but when I went to put elements…
-
0
votes1
answer170
viewsQ: Innerhtml function doesn’t work?
I am using the view engine handlebars, however, when I went to manipulate DOM elements, it continues with the value given to it by the exhaust, follows the code below: monitor page.handlebars:…
-
-1
votes1
answer368
viewsQ: Sequelize foreign key error
Well, I was trying to implement the relationships with sequelize, I don’t know if I misunderstood the documentation but from what I understood it should work, below the model I want to make the…
-
1
votes2
answers383
viewsA: How to export and use a Local Middleware with Express Route?
Hello tdb friend? So from what I understand you’re just having trouble implementing a middleware within a correct route? If this is the case you can use your middleware in the following way by…
-
-1
votes1
answer228
viewsQ: how to receive data dynamically via websocket?
I’m trying to update a <div> which is receiving data from the database in a dynamic way, however, I tried to implement this way and even so remains wrong and do not know where I’m going wrong,…