In the Google Workspace Admin SDK userUsageReport API, is the specified date affected by any time zone? - google-api

We specify the "date" in the userUsageReport as shown in the reference below.
https://developers.google.com/admin-sdk/reports/reference/rest/v1/userUsageReport/get
It is written as follows on the reference, but I'm not sure what it means.
"We recommend you use your account's time zone for this."
I'm curious about the relationship between the specified date and the timezone.
Will it behave like one of the following? Does anyone know?
A. Data is acquired according to the time zone of the user account used for authentication when executing the API.
B. Data is retrieved according to the time zone of each user account specified in the API "userKey or all"
C. Data is retrieved according to uniform UTC or a specific time zone

I believe option 'A' on your question is the correct one based on this article where it states:
Date and time of the event (displayed in your browser's default time
zone)
Every date/time that is logged into the user reports of the Admin Console will be automatically translated into your local time (e.g, the date and time shown in the 'Date' column of the results in the Admin console UI is the local time of the admin generating the report.)

Related

REDCap - Sending out automated emails after searching in the data for condition

I am migrating sql server database into REDCap. I am new to REDCap and I am still investigating the features of REDCap. I am building a survey form that will collect all the data into REDCap. Once the data is there in the REDCap, I want to send emails based on the date in the future. For example, if there are fields in the instrument as below
Email
Expiry Date
test#gmail.com
12/12/2021
I want to send automated email to that email address(test#gmail.com) on that date date (12/12/2021). Basically, it has to look at the data and send out reminders to the email address on the expiry date.
I looked at alerts and notifications. I can write the conditional logic to send the reminder upon data entry. But, here in my case, the data is already stored.
I looked at the scheduling module. Scheduling module is generating events on the calendar but not sending emails automatically.
Is there a way I can achieve this?
Which version of REDCap is your institution on? Since version 9.9.1 you can have an alert send either before or after a date field in your project. So the alert can be configured to be triggered by data import, and the time to send would be, say, 5 days before the [expiry_date].
Here is the changelog entry:
Improvement: A new send-time option has been added when setting up Automated Survey Invitations and Alerts & Notifications. When defining
when the ASI/Alert should be sent, the option “Send after a lapse of
time” has a new setting added so that, if desired, the user may set
the time lapse relative to the value of a date or datetime field in
the project. In previous versions, the time lapse setting could only
be set relative to the time in which the ASI/Alert was triggered. That
is still an option, but now users may also opt to send the ASI/Alert a
certain amount of time either before or after the date/time of a
specific field. This new setting will allow users to have greater
control with regard to setting when ASIs/Alerts will be sent without
getting too complicated in their setup, such as having to use complex
logic (with datediff, etc.).
As the changelog says, another method is to use datediff logic in the trigger, which you will need to use if you are not on v9.9.1 or later (you should also encourage your institution to upgrade since there are important security patches since then). When an alert has a datediff function in its logic, REDCap will check it every four hours (unless the frequency has been changed by your administrators). This means you can send the alert 5 days before the expiry date with this logic:
(existing logic) and datediff("today", [expiry_date], "d", true) = -5
The true parameter here returns the signed value, so that if the first date is later than the second, it will return a negative value. false returns an absolute number.
This will be true on the exact day when [expiry_date] is 5 days in the future.

Want to build an attendance management system using MEAN stack

I want to build an attendance management system using MEAN stack. The application should work like this -
There will be an admin who will control CRUD operations on User and as well as look into the Attendance of each user and have a detailed list of average attendance of the user per month and per year.
There will be a user page and when the user logs in i want to store the date and time in the client side and then send it to the database. So that based on the time and date the admin can see when the user has logged in and mark the user as present for that particular day.
I want to know how to store the date and time in the client side and then pass it onto the database for calculations. Also wanted to know that is it necessary to authenticate in the front end as well?
May be I am late, but I can try to answer your query.
You can store date and time as an object and pass it via request parameters to the backend to store it in the database.
You can take a look a the following on how to get date and time in Javascript How do I get the time of day in javascript/Node.js?

How to update the record automatically based on DateTime field in Dynamics CRM?

I have a field called Expired that is set as a Date Only, Time-Zone independent, Date and Time field.
There is another field Expiration Status that looks at this field and is marked as Expired/Not Expired.
When I create an entity record and set the expiration date to Today I would expect the expiration status to only update to Expired the next day after 11:59:59 PM on Today. How can I achieve this behavior?
The best approach is to have a nightly job (Eg. Scribe package or console app in Task scheduler) to pull all the records that has Today as expiration date & set the status as Expired.
A "no-code" solution would be an UI workflow to wait until Expiry date & set the status. Read more. This is not a good choice.
Update:
Based on waiting workflows count the load increases in Async services, hence It’s not a good choice.
Community discussion on same topic

Square API - Changing Charge Dates to CaptureTransaction Dates

We're using the Square v2 API.
We're setting the delay_capture field to true in our charge API calls. When we then call the CaptureTransaction for that charge, the date of the transaction is the date the original charge call was sent.
Is there a way to set the date of the transaction to the date the CaptureTransaction call was sent rather than the original charge date?
I don't see any support for this in the documentation but I figured I would ask.
Thank you.
No, you cannot change the recorded dates. I'd recommend using another database to store this additional data and just key on the transaction id.

How do I restrict a users access to an object?

Hi Sitepoint wizard people,
Say we have an admin application that has multiple users and various objects. What I'd like to do is control access within the object itself - that is, it will behave one way for one type of user, and another way for other users. For example...
Director Mike can override Reception user Sally's registration date. One would assume that Mike could set any date both in the past or in the future. Then we have Payroll user Steve who can also modify Sally's registration date, but only for dates in the past up until (for example) one year ago. To spice things up, then we have the HR Manager Mary who can also amend Sally's registration date, but only for dates from precisely 23rd June 2007 up until one month from now...
How can I program the access restrictions so that on the front end, the form control is restricted with a min and max date, and in the backend, the validator checks the entered date to make sure it falls between those dates? I'd obviously need to be able to tweak the min and max dates for each user type. Other objects might have different parameters - maximum amount on a discount field or days of the week for overtime, for example.
I've asked this question in different ways, but each time I get bogged down by the implementation. I'm currently developing it as a php/MySQL web-based application, but thoughts and comments from other platforms very welcome! This time I'm looking at first principles, so it doesn't matter what your background is, if you have any ideas, please let me know! What do you even call this type of access control...?
Depending of how you application is based, you could ask for credentials at the start of the application and depending on who is requiring access, you could load a different xml file containing different settings.
As for security issue, make sure that the different xml files can't be reached by the users.
Edit:
Since you are using MySQL you could do something like this.
Let's say you have a table of users that has those fields : UserId, UserName, RestrictionId.
And with a Restriction table that looks like : RestrictionId, FieldName, FieldCondition.
This way, in your php app, when a user is authenticated, you can go fetch the correct "Restrictions" on the field and apply them in your code. If it happens that you have multiple fields that require different rules then you can simply add them with the correct RestrictionId.
This DB design is far from perfect, I'm pretty sure you can do better
Since, you are already using MySql db. You can maintain the UserRole Master table details in DB itself. Load the user role data based on login, then you can easily validate the changes made by the user accordingly.

Resources