Help to Print the ship departure date in the text area with id scheduleDate , seperated by new line character

Help to Print the ship departure date in the text area with id scheduleDate , seperated by new line character
0.0 0

#1

Problem Statement:I would like to develop a web application to generate the schedule for the ship that will be coming to the port every 15 days. Starting date of the schedule is given, generate the schedule for the corresponding year. The carrier will function only in the week days, if the schedule falls on sat or sun then it should be moved to monday.


below code i have attempted just to get UI but need help to generate scheduler as per problem statement
``

Carrier Schedule Generator

<table>
<tr>
	<td>Start date (MM/dd/yyyy)</td>
	<td>
		<input type="date" name="date" id="date">
		<button type= "button" id="generate" onclick="myFunction()">Generate</button>
	</td>
</tr>	

<tr>	
	<td>Carrier schedule for the corresponding year
	    (dd/MM/yyyy)</td>
	<td>	<input type="textbox" rows="10" cols="10" id="scheduleDate" ></td>
</tr>	

<tr>
	<td>
		<div id="result" name="result"></div>
	</td>
</tr>
</table>
``

#2

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://freecodecamp.org.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:


#3

thats is why i have shared the screenshot, looks like you didnt looked into it, also shared problem statement, when user picks the date then while clicking on generate button it should display dates beyond 15 days and take the dates which are excluding Sat and Sun
Below is the snippet, logic is still incomplete, thats why i need help

<body>
<center>
    <h2>Carrier Schedule Generator</h2>
    
	<table>
	<tr>
		<td>Start date (MM/dd/yyyy)</td>
		<td>
			<input type="date" name="date" id="date">
			<button type= "button" id="generate" onclick="myFunction()">Generate</button>
		</td>
	</tr>	
	
	<tr>	
		<td>Carrier schedule for the corresponding year
		    (dd/MM/yyyy)</td>
		<td>	<input type="textbox" rows="10" cols="10" id="scheduleDate" ></td>
	</tr>	
	
	<tr>
		<td>
			<div id="result" name="result"></div>
		</td>
	</tr>
	</table>
    
</center>

<script>
	function myFunction(){
		var str= document.getElementById("date").value;
		var dt= new Date(str);
		var month = dt.getMonth();  
		var day = dt.getDate()+15;  
		var year = dt.getFullYear();  
		console.log(day + '/' + day + '/' + year);  
		//console.log(dt);
		
	
	}
	
</script>
 
	
</body>
</html>

#4

already provided the explanation but still no help :frowning: