Jump to content

Unable to define datetime-local minimum time for current date (HTML&JavaScript/beginner)

c0d0ps
Go to solution Solved by RockSolid1106,

Here is my code:

Spoiler
<input type=
"datetime-local" name="datefield" id="datefield"
min="today_min" max="today_max">
<span class="validity"></span>
<br>
</label>
<br>
<input type=
"datetime-local" name="datefield2" id="datefield2"
min="today_min2" max="today_max2">




<script>
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
//
var hh = today.getHours();
var m = today.getMinutes();

if (dd < 10) {
   dd = '0' + dd;
}

if (mm < 10) {
   mm = '0' + mm;
}


today_min = `${yyyy}-${mm}-${dd}T10:00`;
today_max = `${yyyy}-${mm}-${dd}T10:30`;
today_min2 = `${yyyy}-${mm}-${dd}T15:01`;
today_max2 = `${yyyy}-${mm}-${dd}T15:30`;
//or Year-Month-Day
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min", today_min2);
document.getElementById("datefield2").setAttribute("max", today_max2);
</script>

 

And it works as expected:

Spoiler

 

Hi I'm using a .html file

Languages: HTML, JavaScript
Level: Beginner

 

Problem:

Trying to change datetime-local to min="todayT10" but it doesn't seem to work.

It's so much of a hassle to manually define today as "2022-3-30" so I defined "today" below 

 

HTML

Spoiler
<input type=
"datetime-local" name="datefield" id="datefield"
min="todayT10:00" max="todayT11:00">

 

JavaScript

Spoiler
// input type="date"
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear();

if (dd < 10)
{
    dd = '0' + dd;
} 
if (mm < 10)
{
    mm = '0' + mm;
}
today = yyyy + '-' + mm + '-' + dd;
document.getElementById("datefield").setAttribute("max", today);

 

 

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

you don't seem to set the min but only the max at the end

Software developer.
Case: be quiet! Dark Base Pro 900 Orange rev. 2 MB: GIGABYTE Z590 AORUS ULTRA (rev. 1.0) CPU: Intel® Core™ i9-11900K WC: be quiet! Pure Loop 280mm GPU: AORUS GeForce RTX 3080 Ti MASTER 12G RAM: 128GB (4x Kingston FURY 32 GB DDR4-3600) M.2: 3TB (Samsung 970 EVO Plus 1 TB & Crucial P5 2TB PCIe M.2 2280SS) PSU: be quiet! Dark Power Pro 12 1500W

Link to comment
Share on other sites

Link to post
Share on other sites

32 minutes ago, c0d0ps said:
type="datetime-local"

You're using a type of datetime-local on that element, and hence, the format:

32 minutes ago, c0d0ps said:
today = yyyy + '-' + mm + '-' + dd; //or YYYY-MM-DD

is wrong.

Syntax for the max attribute on elements of type datetime-local is different: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#max

 

The format which you have used is for element type "date".

 

With datetime-local, the syntax should be:

YYYY-MM-DDThh:mm

 

Therefore, your code must be changed to also include hours and minutes:

var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
//
var hh = today.getHours();
var m = today.getMinutes();

if (dd < 10) {
   dd = '0' + dd;
}

if (mm < 10) {
   mm = '0' + mm;
}
    
today = yyyy + "-" + mm + "-" + dd + "T" + hh + ":" + m;
document.getElementById("datefield").setAttribute("max", today);

 

Refer to Mozilla Web Docs(MDN) if you encounter issues where you doubt if your syntax is correct. It has good documentations on how stuff works.

Edited by RockSolid1106
On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

33 minutes ago, bullipatty said:

you don't seem to set the min but only the max at the end

Does this look better? thanks

document.getElementById("datefield").setAttribute("min", "max", today);

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

42 minutes ago, RockSolid1106 said:

SNIP

SNIP

 

Refer to Mozilla Web Docs(MDN) if you encounter issues where you doubt if your syntax is correct. It has good documentations on how stuff works.

										HTML
<input type=
"datetime-local" name="datefield" id="datefield"
min="todayT10:00" max="todayT11:00">
										JavaScript
// input type="date"
var today = new Date();
var dd = today.getDate(); //Current day
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear(); //(Year is 2022)
var hh = today.getHours(); //Current hour
var m = today.getMinutes(); //Current minutes

if (dd < 10)
{
    dd = '0' + dd;
} 
if (mm < 10)
{
    mm = '0' + mm;
}
today = yyyy + '-' + mm + '-' + dd + "T" + hh + ":" + m; //or YYYY-MM-DDThh:mm
document.getElementById("datefield").setAttribute("min", "max", today); 
//Set "datefield" = Minimum&Maximum time to current date

Thanks for help:
Does this cover everything or do I need to define "T" as well?

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, c0d0ps said:

Does this cover everything or do I need to define "T" as well?

I presume you ask this as it doesn't work.

10 minutes ago, c0d0ps said:

Does this look better? thanks

document.getElementById("datefield").setAttribute("min", "max", today);

No, it does not. This is not the right syntax. min is not needed if you are not setting a min value. Just set that line to what it was previously.  That should fix if it isn't working.

On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, RockSolid1106 said:

1. I presume you ask this as it doesn't work.

2. No, it does not. This is not the right syntax. min is not needed if you are not setting a min value. Just set that line to what it was previously.  That should fix if it isn't working.

Thanks:

1. The code below did not work with minimum and maximul values no. 

    I could still put in anytime I wanted (not adhering to my defined values).

2. I do set minimum and maximum values yes.

								HTML
<input type=
"datetime-local" name="datefield" id="datefield"
min="todayT10:00" max="todayT11:00">
<input type=
"datetime-local" id="datefield" name="datefield2"
min="todayT15:00" max="todayT16:01">

								JavaScript
today = yyyy + '-' + mm + '-' + dd + "T" + hh + ":" + m; //or YYYY-MM-DDThh:mm
document.getElementById("datefield").setAttribute("max", today); 

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, c0d0ps said:

Problem:

Trying to change datetime-local to min="todayT10" but it doesn't seem to work.

It's so much of a hassle to manually define today as "2022-3-30" so I defined "today" below 

SNIP

 

1 hour ago, RockSolid1106 said:

I presume you ask this as it doesn't work.

No, it does not. This is not the right syntax. min is not needed if you are not setting a min value. Just set that line to what it was previously.  That should fix if it isn't working.


Any ideas how to go about getting this to work?

Spoiler
<input type=
"datetime-local" name="datefield" id="datefield"
min="todayT10:00" max="todayT11:00">

 

I tried the code below

Spoiler
										JavaScript
var today = new Date();
var today2 = new Date();
var dd = today.getDate(); //Current day
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear(); //(Year is 2022)
var hh = today.getHours(); //Current hour
var m = today.getMinutes(); //Current minutes

if (dd < 10)
{
    dd = '0' + dd;
} 
if (mm < 10)
{
    mm = '0' + mm;
}

today = yyyy + '-' + mm + '-' + dd; 
//or Year-Month-Day
today2 = yyyy + '-' + mm + '-' + dd + "T" + hh + ":" + m;
//or Year-Month-Day&Todayhour:minute
document.getElementById("datefield").setAttribute("min", "max", today); 
//Set "datefield" = Minimum&Maximum time to current date

 

 

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, c0d0ps said:
document.getElementById("datefield").setAttribute("min", "max", today); 

As I already said, this syntax is incorrect. You can't set values for two attributes at once.

 

You can try to set the min to today at 00:00, by:

today_min = yyyy + '-' + mm + '-' + dd + "T00:00"; 

and then setting the value of min to it:

document.getElementById("datefield").setAttribute("min", today_min); 

 

So, your code should look like:

var today = new Date();
var today2 = new Date();
var dd = today.getDate(); //Current day
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear(); //(Year is 2022)
var hh = today.getHours(); //Current hour
var m = today.getMinutes(); //Current minutes

if (dd < 10)
{
    dd = '0' + dd;
} 
if (mm < 10)
{
    mm = '0' + mm;
}

today_min = yyyy + '-' + mm + '-' + dd + "T00:00"; 
//or Year-Month-Day
today_max = yyyy + '-' + mm + '-' + dd + "T" + hh + ":" + m;
//or Year-Month-Day&Todayhour:minute
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
//Set "datefield" = Minimum&Maximum time to current date

 

On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

Hello again, thanks for the help!

2 hours ago, RockSolid1106 said:

SNIP

No, it does not. This is not the right syntax. min is not needed if you are not setting a min value. Just set that line to what it was previously.  That should fix if it isn't working.

1. "You can't set values for two attributes at once."
    You didn't mention this before but it's really good to know.
    Is it an HTML limitation?

31 minutes ago, RockSolid1106 said:

As I already said, this syntax is incorrect. You can't set values for two attributes at once.

 

You can try to set the min to today at 00:00, by:

today_min = yyyy + '-' + mm + '-' + dd + "T00:00"; 

and then setting the value of min to it:

document.getElementById("datefield").setAttribute("min", today_min); 

 

So, your code should look like:

SNIP

 

2.

*Will update here before I leave work* (before 15:45 cet, 11:45 est)

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

46 minutes ago, c0d0ps said:

SNIP

2.

*Will update here before I leave work* (before 15:45 cet, 11:45 est)

 

1 hour ago, RockSolid1106 said:

SNIP

SNIP

and then setting the value of min to it:

SNIP

 

So, your code should look like:

SNIP

 

2.
Forgot to say that I have 2 different attendance forms (different min max):

one for when I enter work (min, max) and

one for when I leave work (min², max²)

but i'll do more tomorrow thank you for help.

 

 

Spoiler
// Define today_min2
today_min2 = yyyy + '-' + mm + '-' + dd + "T15:01";
// Define today_max2
today_max2 = yyyy + '-' + mm + '-' + dd + "T16:00";

 

Spoiler is for me - So I can copy paste to work pc

 

Sorry for spamming you with messages but I think it is fixed. I'll test it tomorrow.

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

22 hours ago, RockSolid1106 said:

SSNIP

SNIP

 

SNIP

 

SNIP

SNIP

 

SNIP

 

 HTML

Spoiler
<input type=
"datetime-local" name="datefield" id="datefield"
min="today_min" max="today_max">
<span class="validity"></span>
<br>
</label>
<br>
<input type=
"datetime-local" name="datefield2" idname="datefield2"
min="today_min2" max="today_max2">

 

Javascript

Spoiler
											JavaScript
today_min = `${yyyy}-${mm}-${dd}T10:00`;
today_max = `${yyyy}-${mm}-${dd}T10:30`;
today_min2 = `${yyyy}-${mm}-${dd}T15:01`;
today_max2 = `${yyyy}-${mm}-${dd}T15:30`;
//or Year-Month-Day
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min2", today_min2);
document.getElementById("datefield2").setAttribute("max2", today_max2);
//Set "datefield" = Minimum&Maximum time to current date

 

This seem right but I can still use a time before 10am for entering work and before 15:01 for leaving work.
What is wrong now?
 

 

 

image.png

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, c0d0ps said:
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min2", today_min2);
document.getElementById("datefield2").setAttribute("max2", today_max2);

min2 and max2 aren't attributes, you want min and max.(last two lines)

 

I've lost track here, could you explain me what you're trying to achieve here?

 

6 minutes ago, c0d0ps said:

This seem right but I can still use a time before 10am for entering work and before 15:01 for leaving work.

This shouldn't be possible from what I can see in the code.

On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

47 minutes ago, RockSolid1106 said:

min2 and max2 aren't attributes, you want min and max.(last two lines)

 

I've lost track here, could you explain me what you're trying to achieve here?

 

This shouldn't be possible from what I can see in the code.

The goal is have 2 datetime-local fields and each of them need to a separat minimum and maximum.
Where:

Spoiler

Title-translation = I started today:

today_min = Start work at 10 am as the earliest
today_max = Start work at 10:30 am as the latest

 

Title-translation = I quit today:

today_min2 = Leave work at 15:01 as the earliest

today_max2= Leave work at 15:30 as the latest

JavaScript code updated (thanks) and the results are:
I can not start work after 10:30 but I can start before 10:00
I can leave work at any time (not only 15:01 between 15:30)

Spoiler
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min", today_min2);
document.getElementById("datefield2").setAttribute("max", today_max2);
//Set "datefield" = Minimum&Maximum time to current date

 

A.png

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

The date selectors are working fine for me. It is evident by the fact that it doesn't allow you to set the minutes if you're off the min and max values.

image.png.e39d0f6e9edd80aa33f833db39e93a1f.png

 

Was caught up with something else, hence the delay for responding.

On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, RockSolid1106 said:

1. The date selectors are working fine for me. It is evident by the fact that it doesn't allow you to set the minutes if you're off the min and max values.

 

2. 

Was caught up with something else, hence the delay for responding.

HTML

Spoiler
 <label for="inskrivning" id="inskrivning1">
Jag började idag:
</label>
<br>
<input type=
"datetime-local" name="datefield" id="datefield"
min="today_min" max="today_max">
<span class="validity"></span>
<br>
<input type="submit" id="inlämning1" name="inlämning" value="Inlämning">
<br>
<br>
<label for="inskrivning" id="inskrivning2" name="inskrivning2">
Jag slutade idag:
</label>
<br>
<input type=
"datetime-local" name="datefield2" idname="datefield2"
min="today_min2" max="today_max2">
<span class="validity"></span>
<br>
<strong>
Arbetstider är mellan 10:00 till 15:01
</strong>
<br>
<input type="submit" id="inlämningSubmit" name="inlämningSubmit" value="Inlämning">

 

JavaScript

Spoiler
var today = new Date();
var dd = today.getDate(); //Current day
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear(); //(Year is 2022)
var hh = today.getHours(); //Current hour
var m = today.getMinutes(); //Current minutes

if (dd < 10)
{
    dd = '0' + dd;
}
if (mm < 10) 
{
    mm = '0' + mm;
}

today_min = `${yyyy}-${mm}-${dd}T10:00`;
today_max = `${yyyy}-${mm}-${dd}T10:30`;
today_min2 = `${yyyy}-${mm}-${dd}T15:01`;
today_max2 = `${yyyy}-${mm}-${dd}T15:30`;
//or Year-Month-Day
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min", today_min2);
document.getElementById("datefield2").setAttribute("max", today_max2);
//Set "datefield" = Minimum&Maximum time to current date

 

1. Idk what is different from your code and mine

My max attribute seems to work but not my minimum

2. No worries i'm only at work for 5/24h per day. No rush man. Just appreciating there's so many of you to help me.

image.png

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

Here is my code:

Spoiler
<input type=
"datetime-local" name="datefield" id="datefield"
min="today_min" max="today_max">
<span class="validity"></span>
<br>
</label>
<br>
<input type=
"datetime-local" name="datefield2" id="datefield2"
min="today_min2" max="today_max2">




<script>
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
//
var hh = today.getHours();
var m = today.getMinutes();

if (dd < 10) {
   dd = '0' + dd;
}

if (mm < 10) {
   mm = '0' + mm;
}


today_min = `${yyyy}-${mm}-${dd}T10:00`;
today_max = `${yyyy}-${mm}-${dd}T10:30`;
today_min2 = `${yyyy}-${mm}-${dd}T15:01`;
today_max2 = `${yyyy}-${mm}-${dd}T15:30`;
//or Year-Month-Day
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min", today_min2);
document.getElementById("datefield2").setAttribute("max", today_max2);
</script>

 

And it works as expected:

Spoiler

 

On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

35 minutes ago, RockSolid1106 said:

Here is my code:

  Hide contents
SNIP

 

And it works as expected:

  Hide contents

SNIP

 

HTML

Spoiler
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>
        Närvaro
    </title>
    <link rel="stylesheet" type="text/css" href="Närvaro.css">
</head>
<body>
    
    <ul name="home, news, contact, about">
        <li>
            <a href="#home">
                Hem
            </a>
        </li>
        <li>
            <a href="#news">
                Nyheter
            </a>
        </li>
        <li>
            <a href="#contact">
                Kontakta Activlink
            </a>
        </li>
        <li>
            <a href="#about">
                Om Oss
            </a>
        </li>
    </ul>
    
    <div class="button-center">
    <button onclick="alert(today)">
        Today's date - Example 1!
    </button>
    <button onclick="alert(today2)">
        Today's date - Example 2!
    </button>
    <button onclick="alert(today3(document.write))">
        Today's date - Example 3!
    </button>
    </div>

    <h1>
        Närvaro Rapport
    </h1>
    <p>
        Här kan ni skriva in Närvaron
    </p>
    <form action="" id="inskrivning" name="inskrivning">
        <head>
            <h2>
                Inloggning
            </h2>
        </head>
        <label for="fname, lname">
            Förnamn&Efternamn:
        </label>
        <br>
        <input list="fname, lname">
        <datalist id="fname, lname" name="fname, lname">
            <option value="Simon Sjöström"></option>
            <option value="Magnus Kallenberg"></option>
        </datalist>
        <br>
        <label for="pwd">
            Lösenord:
        </label>
        <br>
        <input type="password" id="pwd" name="pwd">
        <br>
        <input type="submit" value="Logga in">
        <input type="reset">
        <hr class="hr1">
        <label for="inskrivning" id="inskrivning1">
            Jag började idag:
        </label>
        <br>
        <input type=
        "datetime-local" name="datefield" id="datefield"
        min="today_min" max="today_max">
        <span class="validity"></span>
        <br>
        <input type="submit" id="inlämning1" name="inlämning" value="Inlämning">
        <br>
        <br>
        <label for="inskrivning" id="inskrivning2" name="inskrivning2">
            Jag slutade idag:
        </label>
        <br>
        <input type=
        "datetime-local" name="datefield2" id="datefield2"
        min="today_min2" max="today_max2">
        <span class="validity"></span>
        <br>
        <strong>
            Arbetstider är mellan 10:00 till 15:01
        </strong>
        <br>
        <input type="submit" id="inlämningSubmit" name="inlämningSubmit" value="Inlämning">
    </form>
    <script src="Närvaro.js"></script>
    <script src="Today.js"></script>
</body>
</html>
<!--
    <link href="" target="_blank"> = The home page will open in another tab
-->
<!--
    <form action="/action_page.php">
    AKA learn php
-->
<!--
    placeholder="mm-dd-yyyy 15:01" pattern="[a-m]{2}-[a-d]{2}-[a-y]{4} [1-16]{2}:[0-30]{2}"
-->

 

CSS

Spoiler
.all
{
    display: inline-block;
    position: absolute;
    width: 0;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

body 
{
    background-image: url("Activelink.png");
    background-repeat: repeat;
    background-size: 52%;
}

.button-center
{
    text-align: center;
    margin-top: 1%;
}
ul
{
    list-style: none;
    margin: 0px;
    padding: 0px;
    overflow: hidden;
    background-color: #333;
}
li
{
    float: left;
}
li a
{
    display: block;
    color: white;
    text-align: center;
    padding: 16px;
    text-decoration: none;
}
li a :hover
{
    background-color: #111;
}
#inskrivning
{
    margin: 10%;
    padding: 10px;
    text-align: left;
}
.hr1
{
    width: 30%;
    height: 0px;
    margin-left: auto;
    margin-right: 70%;
}
select::after
{
    padding: 30px, 30px, 0, 0;
    max-width: 280px;
    min-width: 140px; 
    background-color: white;
    height: 32px;
    border: 0;
    border-radius: 0;
    margin: 0 auto;
    cursor: pointer;
    box-sizing: border-box;
    white-space: pre;
    word-wrap: break-word;
}
h1, p 
{
    text-align: left;
}
h1 
{
    
    font-size: 300%;
}
p
{
    
    font-size: 200%;
}
form
{
    padding-top: 0%;
}

 

JavaScript

Spoiler
var today = new Date();
var dd = today.getDate(); //Current day
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear(); //(Year is 2022)
//
var hh = today.getHours(); //Current hour
var m = today.getMinutes(); //Current minutes

if (dd < 10) 
{
    dd = '0' + dd;
}
 
if (mm < 10) 
{
    mm = '0' + mm;
}

today_min = `${yyyy}-${mm}-${dd}T10:00`;
today_max = `${yyyy}-${mm}-${dd}T10:30`;
today_min2 = `${yyyy}-${mm}-${dd}T15:01`;
today_max2 = `${yyyy}-${mm}-${dd}T15:30`;
//or Year-Month-Day
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min", today_min2);
document.getElementById("datefield2").setAttribute("max", today_max2);
//Set "datefield" = Minimum&Maximum time to current date

 

My results
TLDR: datefield does not work
datefield 2 seems to work??

Spoiler

image.png.70d76f9b4500ece53d7c28f6e4713d9a.png

 

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, c0d0ps said:

HTML

  Reveal hidden contents
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>
        Närvaro
    </title>
    <link rel="stylesheet" type="text/css" href="Närvaro.css">
</head>
<body>
    
    <ul name="home, news, contact, about">
        <li>
            <a href="#home">
                Hem
            </a>
        </li>
        <li>
            <a href="#news">
                Nyheter
            </a>
        </li>
        <li>
            <a href="#contact">
                Kontakta Activlink
            </a>
        </li>
        <li>
            <a href="#about">
                Om Oss
            </a>
        </li>
    </ul>
    
    <div class="button-center">
    <button onclick="alert(today)">
        Today's date - Example 1!
    </button>
    <button onclick="alert(today2)">
        Today's date - Example 2!
    </button>
    <button onclick="alert(today3(document.write))">
        Today's date - Example 3!
    </button>
    </div>

    <h1>
        Närvaro Rapport
    </h1>
    <p>
        Här kan ni skriva in Närvaron
    </p>
    <form action="" id="inskrivning" name="inskrivning">
        <head>
            <h2>
                Inloggning
            </h2>
        </head>
        <label for="fname, lname">
            Förnamn&Efternamn:
        </label>
        <br>
        <input list="fname, lname">
        <datalist id="fname, lname" name="fname, lname">
            <option value="Simon Sjöström"></option>
            <option value="Magnus Kallenberg"></option>
        </datalist>
        <br>
        <label for="pwd">
            Lösenord:
        </label>
        <br>
        <input type="password" id="pwd" name="pwd">
        <br>
        <input type="submit" value="Logga in">
        <input type="reset">
        <hr class="hr1">
        <label for="inskrivning" id="inskrivning1">
            Jag började idag:
        </label>
        <br>
        <input type=
        "datetime-local" name="datefield" id="datefield"
        min="today_min" max="today_max">
        <span class="validity"></span>
        <br>
        <input type="submit" id="inlämning1" name="inlämning" value="Inlämning">
        <br>
        <br>
        <label for="inskrivning" id="inskrivning2" name="inskrivning2">
            Jag slutade idag:
        </label>
        <br>
        <input type=
        "datetime-local" name="datefield2" id="datefield2"
        min="today_min2" max="today_max2">
        <span class="validity"></span>
        <br>
        <strong>
            Arbetstider är mellan 10:00 till 15:01
        </strong>
        <br>
        <input type="submit" id="inlämningSubmit" name="inlämningSubmit" value="Inlämning">
    </form>
    <script src="Närvaro.js"></script>
    <script src="Today.js"></script>
</body>
</html>
<!--
    <link href="" target="_blank"> = The home page will open in another tab
-->
<!--
    <form action="/action_page.php">
    AKA learn php
-->
<!--
    placeholder="mm-dd-yyyy 15:01" pattern="[a-m]{2}-[a-d]{2}-[a-y]{4} [1-16]{2}:[0-30]{2}"
-->

 

CSS

  Reveal hidden contents
.all
{
    display: inline-block;
    position: absolute;
    width: 0;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

body 
{
    background-image: url("Activelink.png");
    background-repeat: repeat;
    background-size: 52%;
}

.button-center
{
    text-align: center;
    margin-top: 1%;
}
ul
{
    list-style: none;
    margin: 0px;
    padding: 0px;
    overflow: hidden;
    background-color: #333;
}
li
{
    float: left;
}
li a
{
    display: block;
    color: white;
    text-align: center;
    padding: 16px;
    text-decoration: none;
}
li a :hover
{
    background-color: #111;
}
#inskrivning
{
    margin: 10%;
    padding: 10px;
    text-align: left;
}
.hr1
{
    width: 30%;
    height: 0px;
    margin-left: auto;
    margin-right: 70%;
}
select::after
{
    padding: 30px, 30px, 0, 0;
    max-width: 280px;
    min-width: 140px; 
    background-color: white;
    height: 32px;
    border: 0;
    border-radius: 0;
    margin: 0 auto;
    cursor: pointer;
    box-sizing: border-box;
    white-space: pre;
    word-wrap: break-word;
}
h1, p 
{
    text-align: left;
}
h1 
{
    
    font-size: 300%;
}
p
{
    
    font-size: 200%;
}
form
{
    padding-top: 0%;
}

 

JavaScript

  Reveal hidden contents
var today = new Date();
var dd = today.getDate(); //Current day
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear(); //(Year is 2022)
//
var hh = today.getHours(); //Current hour
var m = today.getMinutes(); //Current minutes

if (dd < 10) 
{
    dd = '0' + dd;
}
 
if (mm < 10) 
{
    mm = '0' + mm;
}

today_min = `${yyyy}-${mm}-${dd}T10:00`;
today_max = `${yyyy}-${mm}-${dd}T10:30`;
today_min2 = `${yyyy}-${mm}-${dd}T15:01`;
today_max2 = `${yyyy}-${mm}-${dd}T15:30`;
//or Year-Month-Day
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min", today_min2);
document.getElementById("datefield2").setAttribute("max", today_max2);
//Set "datefield" = Minimum&Maximum time to current date

 

My results
TLDR: datefield does not work
datefield 2 seems to work??

  Reveal hidden contents

image.png.70d76f9b4500ece53d7c28f6e4713d9a.png

 

 

39 minutes ago, RockSolid1106 said:

Here is my code:

  Reveal hidden contents
<input type=
"datetime-local" name="datefield" id="datefield"
min="today_min" max="today_max">
<span class="validity"></span>
<br>
</label>
<br>
<input type=
"datetime-local" name="datefield2" id="datefield2"
min="today_min2" max="today_max2">




<script>
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
//
var hh = today.getHours();
var m = today.getMinutes();

if (dd < 10) {
   dd = '0' + dd;
}

if (mm < 10) {
   mm = '0' + mm;
}


today_min = `${yyyy}-${mm}-${dd}T10:00`;
today_max = `${yyyy}-${mm}-${dd}T10:30`;
today_min2 = `${yyyy}-${mm}-${dd}T15:01`;
today_max2 = `${yyyy}-${mm}-${dd}T15:30`;
//or Year-Month-Day
document.getElementById("datefield").setAttribute("min", today_min);
document.getElementById("datefield").setAttribute("max", today_max);
document.getElementById("datefield2").setAttribute("min", today_min2);
document.getElementById("datefield2").setAttribute("max", today_max2);
</script>

 

And it works as expected:

  Reveal hidden contents

 

The mistake was having a second JavaScript file 

Spoiler
    </form>
    <script src="Närvaro.js"></script>
    <script src="Today.js"></script>
</body>
</html>

 

 

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 month later...
On 4/1/2022 at 9:02 AM, RockSolid1106 said:

The date selectors are working fine for me. It is evident by the fact that it doesn't allow you to set the minutes if you're off the min and max values.

 

Was caught up with something else, hence the delay for responding.

Hiya again, I changed minimum time from 10 to 07 and max time from 15 to 18 and then my placeholder disappeared.

I am not sure why the placeholder disappeared when all I did was change the time to 3h earlier..?

 

Example of problem - " should be month/day/year 07:-- "

Spoiler

image.png.eca94463956addaef5b8a28073162cd9.png

JavaScript - Changed min and max on both when I start and end work

Spoiler
var today = new Date();
var dd = today.getDate(); //Current day
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear(); //(Year is 2022)
//
var hh = today.getHours(); //Current hour
var m = today.getMinutes(); //Current minutes

if (dd < 10) 
{
    dd = '0' + dd;
}
 
if (mm < 10) 
{
    mm = '0' + mm;
}

startwork_min = `${yyyy}-${mm}-${dd}T07:00`;
startwork_max = `${yyyy}-${mm}-${dd}T10:30`;

endwork_min = `${yyyy}-${mm}-${dd}T08:00`;
endwork_max = `${yyyy}-${mm}-${dd}T18:30`;
//or Year-Month-Day

document.getElementById("datefield").setAttribute("min", startwork_min);
document.getElementById("datefield").setAttribute("max", startwork_max);

document.getElementById("datefield2").setAttribute("min", endwork_min);
document.getElementById("datefield2").setAttribute("max", endwork_max);
//Set "datefield" = Minimum&Maximum time to current date

HTML

Spoiler
        <input type=
        "datetime-local" name="datefield" id="datefield"
        min="startwork_min" max="startwork_max" >
        <span class="validity"></span>
        <br>
        <input type="submit" id="inlämning1" name="inlämning" value="Inlämning">
        <br>
        <br>
        <label for="inskrivning" id="inskrivning2" name="inskrivning2">
            Jag slutade idag:
        </label>
        <br>
        <input type=
        "datetime-local" name="datefield2" id="datefield2"
        min="endwork_min" max="endwork_max">
        <span class="validity"></span>
        <br>
        <input type="submit" id="inlämningSubmit" name="inlämningSubmit" value="Inlämning">
        <br>
        <strong>
            Arbetstider är mellan 07:00 till 18:00
        </strong>

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

51 minutes ago, c0d0ps said:

I am not sure why the placeholder disappeared when all I did was change the time to 3h earlier..?

 

Example of problem - " should be month/day/year 07:-- "

Hi there. The problem here is that the value is now editable.

Your range for the minimum time previously was 1000 to 1030. This means, the time was always to be 10, just the minutes that changed. So the browser showed 10 as the placeholder there.

Your new range is 0700 to 1500. Here, the hours is not fixed, and can be anywhere between 07 and 15, so the browser doesn't show a placeholder there.

On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, RockSolid1106 said:

Hi there. The problem here is that the value is now editable.

Your range for the minimum time previously was 1000 to 1030. This means, the time was always to be 10, just the minutes that changed.

Your new range is 0700 to 1500. Here, the hours is not fixed, and can be anywhere between 07 and 15, so the browser doesn't show a placeholder there.

Thanks for response.


How do I force it to show " 07:00:-- "? (e.g. minimum time as placeholder for both startwork and endwork)

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, c0d0ps said:

How do I force it to show " 07:00:-- "?

You can set the value of that element to what you want.

var dateControl = document.querySelector('#datefield');
dateControl.value = `${yyyy}-${mm}-${dd}T07:00`;

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#value

 

image.png.3d40c386a92eb7e95a8bcc348d9c0dbe.png

Edited by RockSolid1106
Forgot to add dollar signs
On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, RockSolid1106 said:

You can set the value of that element to what you want.

var dateControl = document.querySelector('#datefield');
dateControl.value = `${yyyy}-${mm}-${dd}T07:00`;

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#value

 

 

Update:
I realized that the reset button doesn't include my datecontrol.value = 07:00, what can I do about that?

I'm guessing I would need to customize the reset button through javascript?

Spoiler

image.png.c116a7b2fe67ec66b9f0fca1ad92dab9.png

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, c0d0ps said:

I'm guessing I would need to customize the reset button through javascript?

Yeah, that's what you'll have to do.

On 4/5/2024 at 10:13 PM, LAwLz said:

I am getting pretty fucking sick and tired of the "watch something else" responses. It's such a cop out answer because you could say that about basically anything, and it doesn't address the actual complaints. People use it as some kind of card they pull when they can't actually respond to the criticism raised but they still feel like they need to defend some company/person. If you don't like this thread then stop reading it. See how stupid it is? It's basically like telling someone "shut the fuck up". It's not a clever responsive, it doesn't address anything said, and it is rude. 

 ^

 

bruh switch to dark mode its at the bottom of this page

VPN Server Guide

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×