I'm running a spreadsheet which is using a now() function for a countdown delta.
I want the embedded spreadsheet on my webpage to update the now() function whithout accessing the spreadsheet.
The time triggers that I tried always require a user to load or edit the spreadsheet before it is updating. Even in "File/Settings" changing it to on change and every minute is not helping.
Any ideas?
Why not use the time trigger to update the cell?
function updateTime(){
SpreadsheetApp.openById(ssid).getSheets()[0].getRange('G10').setValue(new Date());
}
As Zig Mandel commented, a much simpler way would be to go into "Spreadsheet settings..." and change "Recalculation" to Every hour or minute.
Related
What is the proper way to delete entries in certain cases in headless-cms Strapi? If one content type gets a specific value.
For example if the date is reached/expired. In my case I've created an events calendar. It has some content types like title, location and date. Each event has to disappear automatically after the event date is reached. How can I achieve this?
I suggest you to user CRON task. This feature is available in Strapi
📚Here is the documentation https://strapi.io/documentation/3.0.0-beta.x/configurations/configurations.html#cron-tasks.
So create your CRON task by following the documentation then, in the function, you will have to fetch data that have the date lower than the CRON function execution date.
To do so you can use Query function.
// Fetch data that have the `yourDateAttributeName_lt` lower than the now.
const data = await strapi.query('article').find({
yourDateAttributeName_lt: new Date()
});
// Delete all entries fetched.
data.forEach((entry) => strapi.query('article').delete({
id: entry.id
}));
I advise reading about custom queries https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#custom-queries
For example, with knex delete could be easy as:
await strapi.connections.default('emails').where('isSend', true).del();
For periodic tasks see how to use CRON https://strapi.io/documentation/developer-docs/latest/guides/scheduled-publication.html
i want to push time in my database but when i push time my $scope.moreadditems variable its save wrong time please help me i am using angularjs
check when i enter time 9:00 AM why this show different time
check jsfiddle
i am adding below time its working fine add in table
but when i click show details its show different time
and also this time in database why
input[time] will always output datetime of 1970-01-01 + the time you inputed, see documentation here.
If you just want to keep the time part, you can use filter date to pick it, and don't forget to inject $filter first.
var timeHHMM = $filter('date')(time, 'hh:mm');
refer demo.
I am using Arshaw full calendar[Angular bootstrap] in my project, but after implementing it, Whenever I go to the day view and click on the time span say 12.00am, day click event gets fired and if I extract date from the view object I get the same date but the timing shows 05.30.0, That means there is difference of 5.30 hours... Why is this happening, I am using the latest version of master calendar. I am sharing the snapshot of the same. Please help, Thank you..!!!
I'm having a hard time to have an active data for the calendar date on my system. I am using Visual Test on SilkTest, and I have noticed that whenever I am clicking a value from the calendar, I'm getting a #time property. And that time property contains the Epoch Time format.
So whenever I try to playback the script, there are instance that I will get an error where Silktest cannot locate the selected date on the recording. Do you have any idea on how can I convert the Epoch time to its specific value?
Screenshot:
Use the identify tool to see whether there are other properties that you can use to identify the control instead of using the #time value.
I not a IT so sorry if what I say or what I write is stupid things.
So I'm trying to create a script in google app to create with a redundancy.
I have two questions:
how to select the calendar where the event will be created
Is it possible to repeat this event each hour?
Thank you for your help
Mainly, Apps script is strongly related with Javascript. You will need it mainly with such datatypes as Date.
Selecting calendar
Following command returns all calendars in array:
var calendars = CalendarApp.getAllCalendars();
Thus you can access each individual calendar by doing this:
calendars[i] where i any number between 0 and (# of calendars-1)
For example if you want get name of 2nd calendar:
Logger.log('name of 2nd calendar ==>' + calendars[1].getName());
Hourly event
You can make for loop for each hour and calling createEvent(title, startTime, endTime) command
More commands in Google Apps Script Reference
With regards