Figuring out which month the user is in while using v-calender - javascript

I have been using v-calendar plugin for one of my web pages. I am stuck in a place where I need to know which month and year the user is looking at to make some specific changes. How can I get this data as the user navigates through the calender.
Refer to: https://vcalendar.io/ for further details.

https://github.com/nathanreyes/v-calendar/issues/125
This Link helped me to understand and use the #update:page and #update:fromPage attributes of v-calender.This returns a list of of the month and year as the user scrolls through the calendar.

Use v-date-picker with mode='range' to get the selected date by user. This wrapper comes with v-calendar. Use the users selected date using v-model to work for specific changes as date changes.
<v-date-picker
mode='range'
v-model='range'
/>

Related

How to force a second HTML date input field to open with the same month as the 1st input

With the HTML input type="date" the pop-up calendar always seems to open with today's date. Is there a simple way with vanilla JavaScript to force the pop up calendar to display a different initial month?
In particular we are building a search function for our website, allowing people to search for events between two dates. Once they have selected their starting date for the search, we want the 2nd date input to pop open displaying the month of their first input. Rather than forcing them to page through from today until 2022 or whenever.
We tried simply getting the value of the first input and applying it to the 2nd, but rejected that idea because every time the first input gets altered, the visitor has to reset the second one. Plus we really don't want a date to appear there until the visitor has chosen one.
Don't really want to use a datepicker script, as most of them are bigger than our entire JS load for this website.

Persisting a date property for a calendar

Need to some advice.
Currently I have a calendar that has one route "/events" (it is a monthly display). Within this route the user can click <<< or >>> to look at different months, in some cases the user will go back many months until they find the event they are looking for (yes there is also a search feature in place), in any given month a user can click into an event ("/events/:id") on a given day to see it's details.
Problem: since it's one route, when the user clicks back it goes to the current date which is initialized when the component is loaded and not to the last month they were on, which means the user would now need to click back <<< a whole bunch of times to get where they need.
Basically what I think I need is to persist the date of the month that's clicked into, but that leads me to other issues such as how do I get rid of this state when the user leaves the page altogether for another section of the site. Any suggestions? The other issue is that the user can actually get to this event from other areas of the site so I need to differentiate based on where the user came from.
I ended up using local storage, which is a good way to persist state without making calls to the db. This is only good if the data does need to be secured.

disable dates in datepicker with orchard

Using orchard 1.6. I've created a form which uses a content type which uses a field (date and time), which allows the user to use a date picker to select the day.
Trouble is the user can select any date. I would like the date to be set for today, and the other dates disabled. How is this possible? thank you for replies
If you wanna know the location of the DateTimeField then just go to following directory :
Orchard.Fields/Views/EditorTemplates/Fields/DateTime.Edit.cshtml
but making change to orchard fields is not a good practice , cause your case is very special.the recommended way to do this is to create your own EditorTemplate and integrate jquery-ui datepicker in your Template view.

jQuery UI datepicker css customization

Let's say I want to display a datepicker. This datepicker represents a disponibility calendar from an hotel room. Knowing this, I want before displaying fetch data from the server to know the disponibility (I know how to do this).
My question is: How can I change the css to show dates with disponibility different from the ones that doesn't have?.
Second Question: How can I disable clicking those ones that doesn't have rooms available.
Example: JetSetter calendar
You can check this page to disable the days you want :
http://davidwalsh.name/jquery-datepicker-disable-days

option to change jquery ui datepicker to just a "yearpicker"

I'm checking datapicker documentation here trying to find a way to change it from a full display date picker to just something where I can pick a year only. But I can't find anything. I tried suggestions found here like this, but it still displays the full view.
.datepicker({changeDay:false, changeMonth:false, changeYear:true})
Can I somehow turn the datapicker to a year picker only?
For my company's website, we used jQuery UI slider instead since year is a single value. In our implementation, we also had to do a year range, a slider also accommodated for that.
http://jqueryui.com/demos/slider/#steps

Categories

Resources