ExtJS 4.2 DatePicker get the first day and last day in the calendar - extjs

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

Related

RRule Repeating monthly calendar event on weekday only

I have an recurring event on the 7th of each month but am struggling to find an RRule that I can put into a text editor and import into google calendar. I need the rule to put the event on the last week day if the 7th falls on a weekend. Thanks in advance.
Due to the fallback condition, I don't think you can achieve this only defining a RRULE, unfortunately.
RRULE in Google Calendar follows RFC 5545 specification.
With RFC 5545, regarding monthly recurrences, you can either set the recurring rule for a specific day of the month (e.g. always on the 7th of the month would be RRULE:FREQ=MONTHLY;BYMONTHDAY=7) or a specific offset of day of the week within a month (e.g. second to last weekday of the month would be RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2).
Only using this specification, I don't believe there is a way to select the previous (or next) weekday in reference to the 7th day of the month.
However you can always achieve this by using a script to generate the dates or interpret an existing list you already have before insert them on Google Calendar.

How to add two certain date limits on start date and enf date in any date range picker in react

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')}.

Angular ui date picker short date format, incorrect past date/year after selection

UI date picker is showing incorrect date when, short date is selected from the format and any date in previous years like 1921 is selected, the date selected will be shown as in year 2021, ideally it should be shown as 1921.
Below is the official implementation, where it can be checked.
https://angular-ui.github.io/bootstrap/#!#datepickerPopup
Steps to reproduce.
Change Format dropdown to shortDate.
Select date as in year 1921 or 1962 etc.
The selected date year would be 2021 or 2062.
Does anyone has any idea about this. Is this a bug in plugin?
I think it's about how ui-bootstrap developers have designed the shortformat.
As you see, there is only 2 digit for the year. I think the two digit are for the actual century. You should open an issue on github and see what they reply.

sencha touch - datepickerfield do not show dates before current date

How do i force the sencha datepicker field to show dates only from current date. And not show the previous dates?
Thanks
As Rob said, its not possible because If i would disable the month january and februari (because it's march) and then proceed to select next year, january and februari should be enabled again. If i have to still achieve it, i have to solve it either programmatically or by validation.

how do i display the current week dates in salesforce?

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

Resources