I have a link that opens up JSON data in the browser, but unfortunately I have no clue how to read it. Is there a way to convert this data using JavaScript in CSV format and save it in JavaScript file? The data looks like: The closest I could find was: Convert JSON format to CSV format for MS Excel
How to get 30 days prior to current date?
I have a start calendar input box and an end calendar input box. We want defaults start calendar input box 30 days prior to current date and the end calendar input box to be the current date. Here is my date vars. The end date would be something like var enddate = startdate – 30; Obviously this won’t work. So
Sort array of objects by single key with date value
I have an array of objects with several key value pairs, and I need to sort them based on ‘updated_at’: What’s the most efficient way to do so? Answer You can use Array.sort. Here’s an example:
How to efficiently check if variable is Array or Object (in NodeJS & V8)?
Is there any way to efficiently check if the variable is Object or Array, in NodeJS & V8? I’m writing a Model for MongoDB and NodeJS, and to traverse the object tree I need to know if the object is simple (Number, String, …) or composite (Hash, Array). It seems that V8 has fast built-in Array.isArray, but how to check
How to get selected month in jQuery full calendar?
We are using jQuery full calendar for displaying events from database. I need to display the events below the calendar according to user selected month onchange. I can get data according to event date but I can’t get user selected month in jQuery calendar. This is the calendar function I am using, I need to get user selected month onchange.
How can I reduce slowdowns from mousemove event?
I’m running a relatively simple function (update a span’s innerHTML) on mousemove. The application is a Leaflet map. When the mouse is moving, there is palpable lag when zooming, panning and loading tiles. I only need to update the span about 10-20 times per second at most. (See here for the page in question; the update is for the X/Z
How to get first date and last date of the week from week number and year?
In JavaScript I want to get first date of the week and last date of the week by week number and year only. For example if I my input is: 2(week),2012 Then my output should be: 2012-01-08 and 2012-01-14 Answer Try this: n1 contains the first day of the week n2 contains the last day of the week As for
jQuery hide dropdown when clicked anywhere but menu
I’m trying to make it so that my dropdown menu shows when you click a button, and hides when you click anywhere except the dropdown menu. I have some code working, as far as not closing when you click the menu, however when you click the document when the menu is closed, it shows the menu, so it continuously toggles
In JavaScript e.target is not working as I expected
I have written some JavaScript that opens an element when an element is clicked. However I can’t get the: This is not working to how I want it because: You can open more than one of the showed elements when I only want one open at a time. When I click inside the element it closes, I only want it
Calculating the maximum value for a decimal using scale and precision
I am working on a JavaScript function that takes two values: precision of a decimal value & scale of a decimal value. This function should calculate the maximum value that can be stored in a decimal of that size. For example: a decimal with a precision of 5 and a scale of 3 would have a maximum value of 99.999.