Need Specific Range Record from Checkin/Checkout Dates - asp.net

We are developing booking software, and the situation is as follows:
There are 2 room pricings dependent on different dates. Each room has separate pricing for weekdays and weekends.
ROOM 1
Pricing 1: 1st sept - 3rd Nov, Weekday: $100, Weekend: $120
Pricing 2: 4th Nov - 29 Dec. Weekday: $110, Weekend: $130
Pricing 3: 30th Dec - 20 Jan, Weekday: $100, Weekend: $115
Now there is a booking Checkin Checkout date.
For example: Checkin: 1st Nov, Checkout: 10th Nov
Now the answers should be something like:
First System automatically pick the slots or ranges it comes in
Calculate the days coming in that specific range, for example how many weekdays and weekends?
Then multiply those weekdays and weekends with the particular pricing they have.
And in result we achieved a List with Weekday and Weekend Rates as a list to show in HTML SELECT on client end.
This can be done in SQL Stored Procedure or ASP.NET CORE C#, help me to get this resolve. I tried a lot of methods but failed. Need assistance from the experts here.

Related

Google Analytics - Wrong count is reported for "users" in specifc Segment compared to actual "Users" count

When I look at the data in Audience Overview and select one of the country segments I’ve set up, for certain time periods I get completely different numbers than those when I’m looking at the segment “All Users” in Geo/Locations.
In below image, "users" from United Stats are reported as 1,773 for period of 2nd May, 2018 to 30th Apr, 2019 (previous period comparison).
But if run country specific report for 2nd May, 2018 to 30th Apr, 2019 - count of users from United Stats are 6,331.
It would be great if you can give any insight into why GA providing diffrence counts.
Thanks,
Chintak.
If a segment contains visitor data, date range is automatically limited to 93 days from your start date. However, your time interval is much higher so the problem I would say is in the configuration of your segment.
See the screenshot below:

Compare Google Analytics date ranges

I am working on a redesign and we would like to validate this by comparing the old design's data to the new design's data. The new design will be used from april 2018. From that moment will we start collecting data through Google Analytics to see if we improved.
What I find difficult is to which date range should I compare this data. Should I compare it to April 2017 (one year ago) or March 2018 (one month ago) or something else?
I think this is a bit easy to answer as you can compare your data with last month March 2018, Also you can wait till 3 months and set the comparison with last 3 months to see any improvement. No need to compare with April 2017 as there might be so many up and down between year.

Business hours for specific Dates in full calendar

I am using fullcalendar to let users book an appointment with clients at specific availability set by the clients. So have to disable the fullcalendar when the client is not available. Currently I am able to set multiple business hours for whole calendar i.e. all the years and months.
But I am not able set for specific chunks of date ranges. I need to set different business hours for different date ranges in full calendar. For example from 5th Jan 2016 to 25th Jan 2016 i want to set business hours 08:00 AM to 06:00 PM after that date I want to set business hours 09:00 AM to 08:00 PM for 1st Feb to 15th Feb. Remaining Date should be disabled for creating event for whole year and above specified date and time should be enabled to create event.
I tried many options but it seems there aren't enough options to fulfill my requirement. So calling for some help if someone can.

How to represent days in timeline tree for Neo4j/graphDB

In reading this blog, this reference, and reviewing the answer to this question, I'm confused as to how one can represent distinct days in a timeline tree. In both cases they show a limited number of days on the example database and my thought is that this model cannot hold if you wanted to model an entire year or an unbounded temporal calendar period.
I am reading these examples such that the 'day' nodes are merely just the number of the day '1', '2', .. '31'. As every month has a day labeled '1', '2', etc, how do you traverse the path when you connect all days to months?
For example, in the attached modified drawing, month 12 and month 1 BOTH have days 1, 2 and 31 in them. When I look at event 2, how do I know if this took place on 12/31 or 1/31? I'd like to model all days for all months and using the template (as I understand it) creates ambiguous paths on the graph that do not allow for discrete temporal queries.
Or should a 'days' entity be a more unique number that represents the number of the day for that YEAR where the attribute for that number is the number of the day in the month?
As it stands I do not understand how you can create a complete timeline tree for an entire year as it is modeled in the above links.
The modified drawing shares the day nodes between months and that's why it's difficult to know whether event 2 took place on 12/31/2010 or 1/1/2011
The timetree for a single year, with a resolution of Day, will have 365/366 day nodes. So the Day node with value 31 is not shared by both January and December, but January and December have their own Day 31 nodes. In other words a day node relates to exactly one month, and a month node relates to exactly one year.
Then you can follow the path from the event back up to the root without having it diverge at month.
Peter's blog post referenced above shows the crossing of December into January but does not share the Day node 31- you can see that he's able to answer all your queries above.
To create the timeline, GraphAware has a module that maintains the timeline for you and helps you attach events as well- http://graphaware.com/neo4j/2014/08/20/graphaware-neo4j-timetree.html
Disclaimer: I work at GraphAware

Time Zone Issues with Calculating Daily and Yearly Profit

OK here is a hardcore question that me and my friend are debating the proper programming solution for.
Let's say I'm running a business in New York at time UTC-4.
My sales rep based in San Francisco, whose time is 11:00 PM on December 31st, 2013 (which is 1:00 AM, January 1st, 2014 in my time) makes a sale that nets the company $1,000,000 USD. He enters the sale in the system as happening on December 31st, 2013, but really, in my time, it happens on January 1st, 2014.
For my 2013 report, do I include the $1,000,000 USD as profit, or does that go in my 2014 report?
A related question to hone in on the problem... how do most companies calculate daily sales for December 31st? Is it the last 24 hours from midnight in the company's HQ timezone, or is it for December 31st from each of it's market's time zones aggregated?
Further, if you only have the date (YYYY-MM-DD) entered for a sale, how should that be converted stored in UTC, being that a UTC day spreads over two unique dates?
Here's a helpful tool I've used to analyze this question:
http://everytimezone.com/#2013-8-27,-420,6bj
From a practical perspective:
It probably wouldn't matter which business day you recorded the sale. Many business end their days early, not necessarily at the stroke of midnight.
Some businesses might use the time zone of their headquarters, and some might use the time of the location where the sale was made. Either approach might be valid.
Of course, if this is an actual concern then you should ask an accountant or tax attorney. The answer may be different depending on your industry, state, or country.
As far as the technical parts to your question:
A date without a time or time zone is just a date. Think of it as a logical position on a calendar - not as a unique moment of instantaneous time.
Without additional context, you can't convert it to UTC. Or any other time zone for that matter.
Since UTC is a timekeeping system and not a time zone, then technically there is no such thing as a UTC day, but that is just semantics. Still, the idea of a "UTC day" would still only cover one calendar "date" - since that is part of the definition of what a "date" is.
It's just that the "UTC day" doesn't align with a "New York day". Just like a "New York day" doesn't align perfectly with a "Los Angeles day".
To blow your mind even more, consider that not every local day is 24 hours. Due to daylight saving time transitions, a "day" might by 23, 23.5, 24 24.5, or 25 hours long. Of course most are "standard days" - which are exactly 24 hours.
If you can keep separate that local time is a position on a calendar, while instantaneous time is universal, then you will find that it all makes sense.
That site you referenced has a nice visualization, and I reference it a lot. But IMHO it should have a different name because it doesn't cover every time zone. Use it carefully. See the IANA database discussed the timezone tag wiki, which has over 500 zones.
I don't know what language or database you are using, but you may find the concepts I described recently in this post on working with Date and Time in RavenDB useful. Specifically, read the section titled "Time Zone Conversions". Even if you use some other technology, the same concepts will apply.

Resources