rainmeter calculating percentage of a school year minus holidays and weekends - rainmeter

How can I, in rainmeter, calculate the number of school days between August 19th 2014 and a certain date? As in, I want to be able to calculate the percentage of how far into the school year today is. So far I have something that calculates the number of DAYS between to dates, but I need to be able to calculate the number of school days too.

Related

How to calculate month and any additional days between two dates using google sheet formula?

I want to calculate month between two date and output how month and any additional days by using google sheet
I use this formula to calculate month but i don't know how to calculate any additional days after a complete month.
DATEDIF(AG2,TODAY(),"M")
Quoting this reference of DATEDIF (emphasis mine): https://sheetshelp.com/datedif/
Syntax
=DATEDIF(start_date,end_date,unit)
start_date Date at which to start the calculation
end_date Date at which to end the calculation
unit Type of output. Choices are “Y”, “M”, “D”, “YM”, “YD”, or “MD”.
...
"M" – Number of whole months elapsed between start and end dates
"MD" – Number of days elapsed after the number of months shown with the “M” or “YM” unit. Can’t go higher than 30.
...

Truncating dates in dc.js

Say I'd like to sum up the number of sales I've made per month, and I have the datetime which sale was made. I also have sales from different years. Is there a convinient way to "truncate" dates so datetimes in the same month and year are equal in dimension? My only solution so far is setting all dates to have day of the month 1.

How to add a simple calendar to my windows store app

I'm working on a Universal windows store app and I want to add a simple calendar so that users can add birthdays of their friends and save them and some other stuff. Is there any simple way to do this?
PS: Using Visual Studio 2013
What I do understand about Calendars, is there are fourteen of them in total that are possible - seven for each day of the week a normal year begins on, and seven more for leap years. You may have to create all fourteen and put them in somehow. There is instead a formula for working out what day of the year anyone was born on by their date of birth, and formulae can be programmed into r or other programmes using perhaps the for loop, or if command. This formula is :
{4(d+y)+x-4c}/28, where d is what number day of the year it is - so Jan 1st, d=1, and so on, but for Leap Years it gets different from Feb 29, y is the year in question, x the closest year before y divisible by four, and c an era constant. For modern dates, c=0, so no worries, but if You go back before September, 1752, it changes, as this is when the British went from the Julian to the Gregorian, while in Catholic Europe it was October, 1582, but these are only a concern if You are into such historical dates. For those, c=1, but may have different values much earlier - if You want to know more, reply to this, and I will get out what I have written on it.
For example, if one was born on 17th May, 1979, you would go :
{4(137+1979)+1976-4 times zero}/28, which equals 372 plus six sevenths - you ignore the whole number, and look at how many sevenths there are. Six means Thursday, and thus the 17th May, 1979 was a Thursday. This is it in short - for more details, if this interests, feel free.
The simple way is in use third-party controls like Telerik Calendar or something free like this one.

How to fit a week into a calendar time hierarchy?

As is usual with cubes, the users want things that don't fit into a hierarchy to be displayed hierarchically. They'd like to see Day > Week > Month > Quarter > Year as the hierarchy, but the problem with weeks is they can be part of 1-2 months, not just 1 month (and by extension part of 2 quarters, semesters, years).
So my question is: how to set up the attribute relationships, and how to set up the hierarchy? Here is what I have, but I know it's not optimal.
Hierarchies (cycle == weeks):
Attribute Relationships:
There is no Cycle -> Year, because it is a many-to-many relationship
There are four types of weeks to concern yourself with:
Week of Year (1-53). Hierarchy: Year > Week
You should decide whether you want Week 1 to begin on Jan 1, or follow the ISO standard
Week of Month (1-5). Hierarchy: Year [> Quarter] > Month > Week
You should decide whether you want Week 1 to begin on the first day of the month, or the first Sunday/Monday of the month.
Week of Fiscal Year (1-53). Hierarchy: Fiscal Year > Week
Week of Fiscal Month (1-5). Hierarchy: Fiscal Year [> Quarter] > Month > Week
You can leave the design as you have it, or even add the weeks to the "Calendar Time" hierarchy, thus only having one hierarchy as requested by the users. This is just what Microsoft calls a non-natural hierarchy. Analysis Services query response time is much slower for these than for natural hierarchies (those with all child levels having a relationship to their parent level). That is why you get a warning in BIDS. You just will have to test if the performance is good enough for your users. If it is, fine. If it is not, maybe fall back from the one-hierarchy solution to the two hierarchy solution described in your question. Then at least the first hierarchy would be fast, and only the second have bad performance.
There are other solutions, but they are all a bit unnatural: Some companies define months to have exactly four or five weeks so that the relationship can be set, but a reporting month starts or ends a few days before or after the calendar month. See e. g. the 4-4-5 calendar article in Wikipedia.

Slight problem with day of the week calculation (base doomsday for a century)

From this online calculator: http://homer.freeshell.org/dd.cgi using its data I've successfully written a working version, however its data is limited to years 1500 to 2600. I want to modify (and make a better one) so that I can calculate for any year > 2600.
Referring to Table X, is there actually a formula to calculate the base doomsday for all base centuries (above 2600)?
I've tried working it out myself by putting centuries higher than this e.g. 2700 gave me a base doomsday of '00', 2800 gave '02;, 2900 back to '00' again...
Help appreciated.
As I understand it, that page's “Base Doomsday” is just an offset to allow for the four-hundred-year cycle of leap day calculations. So, you can extend it indefinitely into the future simply by adding blocks of four centuries.
Are there any other calculators out there that do this?
Two common methods for calculating the day of the week
given a date are Doomsday, which you are using,
and Zeller's Congruence
www.merlyn.demon.co.uk provides
some really interesting information on date/time calculations, various calendar
systems and significant dates as they relate to calendar/date calculations.
The calculator at this link http://homer.freeshell.org/dd.cgi is the best in terms of explaining doomsday algorithm cleanly and clearly for human, with one little caveat.
If you input 2/29/1900, it would say it's a Thursday. Well, there is no 2/29/1900, because it's not a leap year.
Of course if your input 1/35/2016, it would "garbage-in-garbage-out" for you as well.
Imagine there are only 364 days in a year, then the day of week for each date will never change year after year, because mod(364,7)==0.
But we have 365 days a year, so the day steps forward 1 each year, that's where the second term mod(year, 7) comes from.
In addition, every 4 year, there is a leap year, which contributes to the last term mod(year, 4).
But every 100 years, you subtract a leap year, and every 400 years, you add one leap year. That's where the first term "3,2,0,5" comes in.
You see, it's all because of this leap year, and mod(365,7)==1 business.
7/11, 5to9 helps to remember table Z greatly.

Resources