Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
1 answer
154 views

Convert durations to a single unit

In the codebase I inherited, I have this function which converts a number and unit into milliseconds: ...
LocustHorde's user avatar
1 vote
2 answers
121 views

Receiving a daily reward

I'm doing a daily reward system on my site. Users can pick up the reward only once a day. The next reward can be picked up the next day, also, only once. When a user visits the site to pick up a daily ...
Andrew Ourst's user avatar
2 votes
2 answers
228 views

How to handle optional date parameters?

When creating a function to be reusable throughout the project I came across something strange. After looking at this function it looks very much like it could be refactored. The function should only ...
ARNON's user avatar
  • 401
1 vote
1 answer
84 views

JS function to check if a date is in the correct format

I wrote the following JS function to check if a date comes in the right format and can be used further down in the application ...
Jakub's user avatar
  • 271
3 votes
4 answers
118 views

Javascript date / time display

I'm writing a simple start page and it's my first time with JavaScript, my previous background is Python/VBScript. Is it good enough? What best practices should I apply? Should I compress and nest the ...
Fabio Craig Wimmer Florey's user avatar
4 votes
3 answers
179 views

Add missing business days in CSV file

I need to fill missing business days (i.e. any days except saturday and sunday) in a series. So let's say I have this array: ...
oderfla's user avatar
  • 163
1 vote
1 answer
646 views

Find when the shop will next open or close

Intro: I started working three month ago and i have never used JavaScript before, i don't know what is the best practice in JS and i feel like my code can be improved a lot, so i'm here searching for ...
Alberto S's user avatar
8 votes
4 answers
1k views

Check if calendar week number falls within two other week numbers

I want to check with Javascript if a week number (with year) is within two other week numbers. Example data: Year-Week ...
Allart's user avatar
  • 183
3 votes
0 answers
49 views

Calculate difference between dates and output desired result like (Today, Tomorrow, or 20 Days from now)

I'm writing a task list tracker with VueJS. Each task has a Frequency label (How often it needs to be done), Last completed date label (When the task was completed ...
babis95's user avatar
  • 131
2 votes
1 answer
63 views

JavaScript function for the get the formatted date of tomorrow

I need a JavaScript-function which always computes the date of the next day. Then returns the date as a string, formatted in the way: dd.mm.yyyy I wrote this code: ...
michael.zech's user avatar
  • 4,294
10 votes
4 answers
2k views

Calculating parking fees, given start and end timestamps

Since I have just started Javascript, I am trying to solve a few problems and improve myself. I encountered such a question. I tried to do everything step by step from the question, but I do not think ...
Mustafa Guner's user avatar
2 votes
1 answer
125 views

Countdown click in JavaScript

I did a small countdown clock challenge in JavaScript. Please review it, thanks. ...
user3132457's user avatar
3 votes
2 answers
692 views

Calculate age given the birth date in the format YYYYMMDD

Here is method to calculate age given the birth date in the format YYYYMMDD. ...
dftd dftd's user avatar
3 votes
2 answers
25k views

Checking if the access token is valid or expired

Basically, the server gives me a token object. I am planning to check the token on the client if it is expired/valid before ...
dcangulo's user avatar
  • 193
6 votes
4 answers
3k views

Convert minutes portion of time to decimal

I am making an hours calculator app. It takes a start time, end time and time taken for lunch. For the start and end time it takes a four-digit hh:mm time. For example: 10:20. I have made a function ...
Ruari Douglas's user avatar

15 30 50 per page
1
2 3 4 5
13