I'm working on a project in Delphi 7. I'm trying to let a user select a day by clicking on a day on the TCalendar component, the corresponding day has to be found in an array and the event should be displayed. Any ideas how to do let the user select a day on the calendar and use this as a variable?
Any ideas how to do let the user select a day on the calendar and use this as a variable?
Read the calendar date with the CalendarDate property. Or the Day, Month and Year properties. Exactly how you then look up your events depends on how your events are stored.
Related
I need to use a date range picker in which I need to implement the logic
Start date can be upto 6 months from today well end date will can be up to 6 months from a start date in a single date range selector
Well I played with different packages but I can able to set a limit on any one date.
Suggestions are appreciated
You can use react-calendar with moment, it supports some props two of which are minDate and maxDate.
Render two instances of react-calendar, pass minDate={moment().subtract(6, 'months')} and maxDate={moment()}.
Disable the second instance by default or render it only when user select a date in the first instance of the calendar.
Then pass minDate={dateSelectedInFirstInstance.add(1, 'day')} and maxDate={dateSelectedInFirstInstance.add(6, 'month')}.
Im developping a MEAN stack web application where one of the functionalities is that a user can reserve a room to organize an event.
An event can only last one day. I want the user to select a certain date and time when the event takes place. I used datetime picker for the starting moment of the event, and an input field for the duration (in minutes). This isn't so user friendly in my opinion.
Anyone got an idea on how to implement it better ? I've been thinking about a datepicker with 2 timepicker (for start and end time) or just 2 datetime pickers. I don't prefer the second option because a user can only select 1 date, not a date range. For example a user can select monday 12th of march 2018 as a date, but he/she cannot select a multiple dates (from monday to friday for example).
Thanks in advance.
Edit:
There can be multiple events on the same day in the same room. The times just can't overlap. For example there can be an event from 4 to 5 p.m. and another event from 6 to 8 p.m. (There are 4 rooms in total. A user can select a room of choice (if its free at the given time)).
An event can only last 1 day. A user can only select 1 date not multiple.
I am trying to build a week view of the month with customized cells, so the Calendar class won't work for me.
I am having trouble knowing on which day the month starts. For example, January 1st was a Friday. Also, I need to know how many days a given month has.
Without telling me the exact code, can you tell me the variables or methods I could use for this?
Look at the actual code for the Calendar class here: http://github.com/codenameone/CodenameOne/
Just set java.util.Calendar to the right date then use the get method to get the day of the week.
I have an ExtJS datepicker where I disable some dates so the user can't select them.
After the calendar is renderer I send to the server the current date and the server sends back an array of days to disable, so the visual result is the following:
The problem I have is that I don't know the first and last day showed in the datepicker.
In this image the first day is 08/31/2014 and the last day is 09/11/2014. How can I get those dates, so I can tell my server to check if within that range I have to disable any date.
In the calendar example the "yellow marked dates" have to been disabled.
Any clue? Appreciate in advance.
Check this fiddle: https://fiddle.sencha.com/#fiddle/8ms
this uses minDate, maxDate with disabledDates, disabledDays combination..to enable particular days and disable all other days.
You could arbitrarily set the minValue to this month's first day and maxValueto this month's last day and then assume this on the backend side.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.Date-cfg-minValue
Here's how to get current month's first and last day
Get first and last date of current month with javascript or jquery
I am trying to display dates of current week. How can i do it? What i am trying to do is display the timesheet for the week.
So if i view the page today then it should display me the current week dates. Any pointers to approach this problem would be very helpful
Thanks
Prady
I would think you could use the Date.toStartOfWeek function and then use addDays to that Date 7 times to determine the rest of the days of the week.
The reference is here:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_date.htm