workflow / option to expand other options? - javascript

I have a question about a conference quotation form that I am building.
Once the user enters various information such as the conference date, number of delegates etc, I need other options to appear dependant on the duration of the conference. ie. If the user inputs dates showing that the conference will last 3 days - then 3 "sections" needs to appear for each day of the conference with inputs regarding meals for that particular day, etc.
What route could I take to accomplish this?
I am struggling to explain - so If i am not clear, please tell me and I will try to explain better
thank you

I'm sure you'll find something here: jquery datepicker difference
If you have the difference in days you can simply add a for loop
for(var i=0;i<differenceInDays;i++){
$('#days').append('<input name="day'+i+'"/>');
}

Related

Javascript/CSS: create graph animation based on data changing in time

Don't ask me why but I made up my mind to create an animation of a graph like the one you see in this video with Javascript
https://www.youtube.com/watch?v=FJi5LcWpznw
My data are similar to
2023-01-01 user1,10 user2,12
2023-01-02 user1,11 user2,12 user3,1
2023-01-03 user1,11 user2,14 user3,12 user4,5
and so on .. day by day
Can you help me to convert my madness into all this?
Thanks in advance
You're going to need more data, otherwise your video is going to only have three states in it...
I'd start by creating a static graphic, using your favorite JavaScript charting library (https://www.chartjs.org/?) I'd store all this data in a day-sorted array. After you get that working, then I'd come up with a mapping between days and seconds. For a very limited number of days, I'd probably do something like 1 day = 3 seconds. Then, I'd create an event loop, and every three seconds, pick out the next datapoint from the array, and update the graphics. After that point, you need to record your browser.
You'd better update your question quickly before the stackoverflow admins reject it for one of their many, many, many reasons and edit my response into oblivion.

How to dynamically change a field depending on a unique date formula

I'm working on a work schedule of sorts, a feature that I'm trying to create would be one that can be setup initial and would not need to be touched ever again. However I'm not sure where to even start; I have a weekly schedule with three different fields, a middle field that is unique and requires no attention and a day/night field. My user is able to drag users into these fields and set that they are expected to working during that period. However as my user has different shifts that sometimes overlap I'm looking to color code each of the shifts of which there is a total of five, the shifts go on a pattern of working: 2 nights, than 2 days off, than 3 days working and lastly than 2 days off. What would be the best approach of mapping this as I cannot simply put that Monday nights are color X as the by the time next weeks comes around the shift would be starting on Wednesday, along side this some shifts will be working at the same time so the color coding should not cover the entire day but only a limited number of entries (2). My initial idea was to try using Hashmap or something of the sort but I'm uncertain how I would structure it to achieve what I'm looking for..
Drag and drop experience would be nice but I assume not mandatory, so can try to use standard features. Im not sure which user is using this - the worker doing the shift, or a manager allocating workers to the shifts? If is for a manager - If you created a 'shift' object and had shifts represented as records you'd be able to create list views of those shifts ie. 'next n days','this month' etc. Then you could use bulk action within the list view to assign a user to multiple shift records at a time. Would be reasonably efficient and quick to build. Just a thought... (and I couldnt follow what you meant about color coding sorry.)

How to render a event within time slot in full calendar?

In my project, I want to place an event within time range. For example 09:00 am to 10:00 am. I Googled many times, but not links found.
I'm not clear if you are asking help to make a full calendar using jQuery.
More information might be better.
Anyway, I think this will help you.
jQuery Calendar time selection suggestion

duration and repeat

I'm trying to put the logic together for this and it seems like I cant get no where. I have my repeat all set depending on week(s). But what about duration? Let's say someone is schedule for 2 days (duration) for every week (repeat). How would I put this together depending on two given dates?
http://jsbin.com/usori3/15/edit
Hopefully this page will have all the answers Javascript date object. You can add days to a date to get a new date (2 days for your schedule) then add another 5 days (to complete the week) to start the repeat. Compare that date to your end date to see if you've finished. As Daniels says in the comments, it would be good if you could be a little more specific, but I hope that answers your question or at least points you in the right direction. It may even be worth looking at JQUERY to see if there's a plug in for the date handling that may help you further.

javascript calendar

I was wondering if there was a simple way to make a topdown list calendar for a website. I don't want to use the google calendar. I would also want the calendar to show like the next 5 events and hide the rest until the 5 shown have already happened. If there is a way to do this with jquery I wouldn't mind doing that either.
Here's a good starting point:
http://www.javascriptkit.com/script/cutindex1a.shtml
Just about every layout for a calender structure, and then event-show limiting etc could be implemented by you at the end. At the least it'll give you a base with which to work from.
Hope that helps.

Categories

Resources