Full Calendar weekly Mode - jquery-plugins

I am trying to build an application that displays a weekly Monday to Friday school schedule. I've decided to use the JQuery plugin fullcalendar. After looking through many options, I cannot find a way to display a weekly mode rather than actual days of the year. Agenda mode displays a given week of the year. This includes dates which I don't want.
I want events to begin on Friday at 2:00pm not April 5 at 2:00pm
Is there way to do this using the fullcalendar API?

Take a look at the columnFormat option. http://arshaw.com/fullcalendar/docs/text/columnFormat/
columnFormat: {
month: 'ddd',
week: 'ddd',
day: 'dddd M/d'
}
Let me know if this helps.

Related

dotliquid: Add Days but ignore saturday and sunday

our ERP (JTL) allows us to create workflows using dotliquid.
For our production we need a workflow that adds a fix amount of working days to the creation date of an order. However it may not add Saturday and Sundays.
Is it possible to filter the days added so we don't have to manually convert working days to days?
{{ CREATIONDATE | AddDays:X | Datum:'yyyy-MM-dd'}}

Laravel Carbon find same day of week in previous month

I am trying to find the same day of week from last month if today's date is Wednesday Oct 2nd 2019. I need to retrieve Wednesday Sept 4th 2019.
I am using Carbon and have tried subDays(30) and subMonth(1) but that obviously doesn't return the same week day.
SalesLogs::loadByDate(Carbon::now()->subMonth(1));
This code works as expected, however I am unable to work out how to make it find the same day of the week based on the prior month.
It's not super clear what you are trying to do, but I will take a shot at it. What about if you subtract a month, and then go to the next matching weekday?
$weekday = now()->dayOfWeek;
SalesLogs::loadByDate(now()->subMonth(1)->next($weekday));
Note: you can take advantage of Laravel's handy now() helper function, which is equal to Carbon::now(), but saves you from having to import Carbon.
Does that get you what you need?

Kendo UI scheduler - handle leap years

I am using Kendo UI scheduler to show my events and I have events that should be shown for each year on a specific date.
To achieve that, I use yearly reference rule and everything works fine until event's date is not 29th February. In that case my event get's pushed to the March 1st, even if current year has that date.
The only case in which my date doesn't get pushed to 1st March is if event's date is set to 29th February of the current year.
Is there any way to handle this as I didn't find any info regarding leap
years in the Kendo UI documentation?
According to telerik, currently it can be done only by using more specific recurrence rule.
For 29th February that would be: "FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=29".
My solution was to generate specific recurrence rule for each record by using following method:
private string GenerateEventYearlyRecurrenceRule(DateTime eventStart)
{
return $"FREQ=YEARLY;BYMONTH={eventStart.Month};BYMONTHDAY={eventStart.Day}";
}

Complex Date Range

I'm working on the following query and cant figure out the final piece of it. I need my query to give me a result set between the previous business and the previous business day minus (-) 28 days. (e.g. date range between 10/28/2015 and 10/28/2015 -28) The query that I wrote so far is only giving me the -28th day (09/30/2015) and NOT a range in between the previous business day and the previous business day -28. My research shows a couple of different ways of doing it and so far none have worked for me.
SELECT SMBL, SUM(NET_FLOWS/1000000.00)
FROM HISTORY
WHERE DATE - 28 = DATE AND DATE = TO_DATE('10282015','MMDDYYYY')
AND SYMBOL IN ('AAA','BBB')
GROUP BY SMBL
First off, date ranges are easy using BETWEEN, so you do the quick solution:
WHERE DATE BETWEEN (SYSDATE-28) and (SYSDATE-1)
Then you realize your dates have time components, so to include all of yesterday and all of day-28 you need to:
WHERE DATE >= TRUNC(SYSDATE)-28
AND DATE < TRUNC(SYSDATE)
Then I look at your rule "previous BUSINESS day" and ask - what are your business days? On a Monday to go up to the previous Friday? Or Saturday? Or are you a 7-day-a-week business? How about statutory holidays? And is it 28 CALENDAR days back? Or 28 BUSINESS days?
Ahh business rules. The devil is always in those details....

How to change the starting date of a Calendar Year to something other than Jan 1st?

I'm writing an app that relies on the calendar and calendar events to display data to the user.
I need to be able to let the user select the beginning of his/her 'fiscal' year in settings, which will be the 1st of any of the 12 months. This is an app for military users, and any given unit's fiscal year can begin on whatever month their unit (base) decides.
The data I'm displaying to the user needs to be divided into 'fiscal' quarters according to the user's setting of the beginning of the fiscal year, not calendar year.
I'm not having problems retrieving, editing or deleting the events, I can't figure out how to change the beginning of the year to anything besides Jan 1st.
I found NSDateCategoryForReporting on GitHub, that seems like it's exactly what I need, but how do I tell it that the year begins on the 1st of x month?
iOS doesn't natively support this, so you'll have to find a plugin to do this or write your own. Your best bet is to write a class that performs the date conversions using the standard NSDate, NSCalendar, etc.
For instance, you could store what day the user specifies as their starting fiscal year. Then you can calculate the number of days difference between that and January 1st, and just shift dates based on that.

Resources