How can I create advanced recurring event rules in Google Calendar? - icalendar

I've recently taken over some accounting responsibilities at my workplace. Office payroll is due on the 10th and 25th of each month, but in order for the money to arrive on time, it must be processed at the very latest by 5:00 PM two business days prior to the last business day on or before these payroll due dates. How can I set something like this up in Google Calendar?
I've been reading up on iCal import tweaks (create an iCal file and import it instead of making the event in gCal, to have more flexibility) but can't find a way to subtract a number of days (or business days at that).
VERSION:2.0
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYSETPOS=-2
SUMMARY:Pay Office Staff
DTSTART;VALUE=DATE:20190815
SEQUENCE:0
DESCRIPTION:Send office payroll.
END:VEVENT
END:VCALENDAR
I have no idea how to make it work except to do the date math in a Google Apps Script and have it create the events each month. I'm hoping someone can direct me to where I can find more information about how to achieve my desired result. I expect when it's done (if even possible) that I'll have a recurring event that takes place 2 business days prior to the last business day on or before the the 10th and another for the 25th.

Related

ICS converting to different timezone when it shouldn't

I'm using a scheduling component in a Joomla site that generates ICS files in the confirmation emails. The site and server are set to Los Angeles time zone. The users scheduling the appointments (and me testing it) are also in Los Angeles time zone. However the ICS file converts the appointment to 8 hours earlier than it should be when brought into iCal, Google calendar, and Outlook instead of keeping it to our local time zone.
The developer of the component is testing it from a different time zone 8 hours ahead of mine. He says when he books from my site, it converts correctly to his local time zone and he doesn't see any problem with the ICS file.
This is the code in the ICS file. Is there an issue here that I can pass on to the developer that could be causing it to convert correctly when in different zones, but incorrectly when it's supposed to stay the same time zone?
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
UID:61d73f89b2993
DTSTART;TZID=UTC:20220113T163000Z
DTEND;TZID=UTC:20220113T164500Z
DTSTAMP:20220113T163000Z
ORGANIZER;CN=Clark County Composts:mailto:Pete.Dubois#clark.wa.gov
CREATED:20220106T191417Z
DESCRIPTION:Peter DuBois From: 4:30 PM To: 4:45 PM \nPhone or Zoom: Zoom
LAST-MODIFIED:20220113T163000Z
LOCATION:Virtual Consult
SUMMARY:Training Consult
SEQUENCE:0
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
Thanks
Karen
Two points:
Firstly, DTSTART;TZID=UTC:20220113T163000Z is invalid. One uses either the Z suffix OR TZID, not both at the same time. See the 3 forms of datetime specification for RFC5545 at https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.4. You can also use (use all as they differ) the various ICS validators.
Secondly it is perfectly OK to issue the ics in either UTC or Z format. Any receiving application should deal with the timezone changes correctly depending on the timezone settings of the user. Usually when a user says it's wrong, they haven't realised that their app maybe has a different timezone and/or they have forgotten about daylight saving.

How to deal with large ICS files?

My application (php/laravel, but irrelevant here) holds calendar entries for its users (comparable to a car logbook), and some users want to sync those events to their calendar app of choice. I started looking into the ics standard (RFC 5545 etc.) and created an endpoint that generates those files.
Problem: The files are getting huge. Some users have their entire driving history with hundreds and thousands of entries in the application, generating and transfering those MBs of ICS files will take ages (using php, anyways), let alone doing that everytime the calendar app tries to sync.
Question(s): What is the preferred way of dealing with huge ICS documents? HTTP headers and caching is one thing, but how do other people solve this problem? Just send events of the last year? Is there a (pagination?) spec that I haven't found yet?
This is historical data, so it is not going to change. You could offer batches by time period and cache the historical batches. Last years, or anything before the last 4 weeks, never gets updated for example. They do a one-off import of each historical batch into a separate 'driving history' calendar. No more subscribing? Or maybe they can only subscribe for the last month say?
One cannot import & subscribe into the same calendar, so it does mean they would have at least 2 calendars - 1 historical calendar used for imports, and 1 'current' that will update with yesterday's ride. Of course there is then manual effort for anyone who wants to always have the old data as when events fall off the 'current' calendar, at some point they'd have to go import the latest 'old' events.

Make sure mobile user isn't sending fake date, time and timezone to the server

A mobile app has a check-in feature for the user to send a photo and observation and the app will append his location, date and time to the request, and send it to the server.
It is extremely important that this date and time is not faked by the user, or else the user will be able to be late at work but check-in with a fake "15 minutes ago".
The server is in USA, and the users are in many countries so there are different date and timezones, for that reason I think I can't use server date and time.
That check-in is visible in a website to users all around the world, but the check-in time must be the one from the user who made it.
Example
User checks-in at 5th July 13:45 in Mexico.
Website should show this date and time, 5th July 13:45, even if it's visualized by someone in Japan.
Problem
User checks-in at 6th July 09:37 in Brazil, but he fakes his mobile date and time settings to say it's 6th July 09:00 to pretend he's not late for work.
How can the sever know it's actually 6th July 09:37 and not 09:00, and show that correct date and time to whoever sees it anywhere in the world?
Keep in mind that user can also fake his timezone and GPS, still the server needs to get the real timezone to show real and not mislead information.
It is extremely important that this date and time is not faked by the user, or else the user will be able to be late at work but check-in with a fake "15 minutes ago".
This part is best handled by taking a UTC timestamp from the server when the request is received.
The server is in USA, and the users are in many countries so there are different date and timezones, for that reason I think I can't use server date and time.
Time zone is irrelevant for this purpose. Get the UTC time from the server, not the local time. The local time of the server should not ever be used in your application code.
If you need to adjust it to a particular time zone, then you can collect that from the user in a variety of ways, or you could assign one permanently to the user by some administrator of your application. Even if the time zone is wrong or faked, it won't affect the duration of time worked - because you captured that in UTC.
Example
User checks-in at 5th July 13:45 in Mexico.
Website should show this date and time, 5th July 13:45, even if it's visualized by someone in Japan.
That's fine. Save that the user is in Mexico (... actually, Mexico has several time zones, so you'll need to be more specific - use an IANA time zone identifier). You can convert the UTC timestamp to Mexico time whenever you like - either when you recieve the timestamp (saving both UTC and Mexico time), or when you display it to the user (saving only UTC and converting to Mexico time at the time of display). That the user is in Japan is also irrelevant to this scenario.
Problem
User checks-in at 6th July 09:37 in Brazil, but he fakes his mobile date and time settings to say it's 6th July 09:00 to pretend he's not late for work.
That's not an issue if you capture the time in UTC at the server and make sure your server's clock is synchronized properly.
Keep in mind that user can also fake his timezone and GPS, still the server needs to get the real timezone to show real and not mislead information.
Indeed. You can't capture this information from the user in a way that can't be falsified. However, you can avoid relying on this in your application code. For pure duration calculation, just base everything on UTC. For more complex things (like determining shift differentials or daily overtime working over midnight or at other peak local hours, etc.) then have some other user set the time zone that's applicable rather than collecting it. For example, assuming these are employees, the employee's manager or HR department would assign a time zone to the employee's personnel record.
Of course, if the employee is traveling for their job, and local time rules apply differently in different time zones, then you have even more logic to think about how you capture such details. (My experience tells me this is rare.)
You can't do what you want to do. Your app relies on the mobile device's OS to get things like date, time, timezone and gps. While it's harder to fake gps data on out of the box OS's it's always going to be possible. What you really want is a "backdoor". A backdoor that will let you get to the user device's "real" information no matter how hard the user tries to hide it. If that were possible we wouldn't need/have hackers and government cyber security teams. Anyone who knew the backdoor could just find anyone else in the world.
You can only try to catch such abusers using some of your own measures. You can check if the users time zone is changing. Or using an ip address from a different country since the last time he/she used the app. Or if you're really going to ask for gps permission, you can also see if that person's location over time doesn't make sense (E.g the user was in Canada but 3 hours later it looks like they're in China). Once you detect such possible abuse, you can flag the account for human review.

Send email each month based on values in CRM 3

My company is using Microsoft Dynamics CRM 3, and I'm having some trouble setting up an automatic email. My manager wants to have it setup so that if we bill our customer on the 15th of the month, we send an email out on the 14th, and if it's on the 1st, we send one out the 30th/31st, etc. etc.
I've come across a few helpful things, but my issue is I don't have access to the actual code for the CRM - if it's the only way, it's the only way, but for now I've been trying to setup workflows, but those can only be ran manually - it wouldn't be a MAJOR issue, but then we would have to choose the people to email it to every month, etc etc. I also tried a marketing list, but that doesn't let me send out emails, unless it's through a quick campaign.
Does anyone know of a built in way in CRM 3 to setup automatic emailing each month to a group of customers with a similar value in a particular textbox?
Ok, I had done this sometime ago, you're right, there is not such "scheduled workflow" in CRM 4, but you can simulate this behavior using two workflows, one calling another when the former times out as condition. The first time you have to invoke it manually. Give me some time to find the virtual machine where this project is hosted for more details.

iTunes Connect, check total sales? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Is there a way using either iTunes connect or the API to check the total number of application sales for a particular app since release. I am just curious as ITC on the iPhone only seems to show 26 weeks when displaying totals, so it missed off the first 20+ weeks. (the app has been out for about 50 weeks).
I would just like to see Release to Now, total sales = 4067 is this possible?
From the Apple User Guide for the Financial Reports (available at bottom of iTunes Connect page):
We do not store or regenerate the data after the periods have expired
(14 rolling days and 13 rolling weeks); you will need to download and
store this data on a regular basis if you intend to use it in the
future.
So the answer is: no. It's so ridiculous -- 500GB of storage costs peanuts (yes I know IT storage costs more, redundancy, management, backups, archiving, blah blah, etc.), but it's still cheap. Apple could keep a "total shipped" record and it wouldn't hurt them.
You might want to have a look in the section "Payments and Financial Reports" within iTunes Connect. There's an overview of your total sales within the "Summary" tab . However this view is only updated on a monthly basis.
From the "Sales and Trends" iTunes Connect FAQ
How long are reports available for download?
Weekly Report: Thirteen (13) rolling weeks prior to the current week are available for download.
Daily Report: Seven (7) rolling days prior to the current day are available for download.
Information is only available for the periods following the date when the reporting was activated in iTunes Connect. Reporting is generally activated prior to any sales on the App Store.
You need to store you own records, Apple only stores a limited amount for documented time periods.
But if you look at your financial reports, they may contain data covering earlier months.
Added: In fact, for the correct sales or download numbers, one should only use the monthly financial reports, as Apple says that the daily and weekly trend reports should only be used for estimation purposes.
The iOS iTunesConnect app will show you data for the prior 26 (and 13 and 5 etc) weeks. This can help if you missed some weekly data from the ITC www mothership.
There is now. We (appfigures.com) are actually in the process of testing functionality that uses all of the data sets Apple gives (along with some magic) to give you an accurate all-time total for all metrics (downloads, sales, updates, etc).
We have this in beta right now so if you'd like to give it a try contact us directly through the site and we'll get you in. We're hoping to make this available to all users very soon.
FYI - This new feature works even if you've just opened a new appFigures account.
I don't rely on Apple, I just check my Google analytics report for total uniques and just infer from that.
Now, apple provides reports until 2008.
So, i downloaded the previous years, months, weeks and days reports and concatenated them together with excel to get the total downloads and updates using excel filters.
You can view sales by day, week, month and year by clicking the date in the top right hand corner of the Sales and Trends report for your app in iTunes Connect.
it seems to go back a few years, so should show you the figures you need.
it seems apple has updated the available periods as below from AppStoreReportingInstructions :
Reports are only available at certain times and only retained for
certain periods. Reports should be downloaded regularly for your
records.
• Daily reports include data for the previous day in the selected territory and are retained for 30 days.
• Weekly reports include data starting on Monday and ending on Sunday of the previous week. Weekly reports are available on Mondays
and retained for 26 weeks.
• Monthly reports are available five days after the month’s end date and are retained for 12 months.
• Yearly reports are available six days after the year’s end date and are retained indefinitely.
• All reports are generally available by 9:00 a.m. Pacific Time (PT).
Apple does not store or regenerate the data after these periods have expired.