Background:
Hello, any help with this is much appreciated. I’m pretty new to JavaScript, but learning quickly. So far I am proficient with variables, functions, scopes, oh—and commenting things to death!
Problem:
I’m trying to create a script that creates a new event that automatically fills in some recurring contextual information in an [Events] table. However, I cannot find anything anywhere about entering/recording the time of day into a {Date/Time} field when running a script. The event is always at the same time 12pm-1pm (EST in my case) but the date is what needs input(ed) by the user running the script.
So Far:
// identify base and table info
let table = base.getTable('Event List');
// user input "Event Name"
let eventName = await input.textAsync('What\'s the name of this event?');
// Create new record with default event criteria in the [Event List] table
let recordId = await table.createRecordAsync({
'Event Name': eventName,
'Event Type': {
name: "My Cool Event"
},
'Status': {
name: "Planning"
},
'Start': new Date(), // This just inputs today's date/time in the "Start" field
'End': new Date(), // This just inputs today's date/time in the "End" field
});
Clarification:
So the focus about my question is on the 'Start' and 'End' fields towards the end of this script. Right now the new Date() call records today’s date/time. But what I’d like to do is ask the user to input the date for the scheduled event—and only the date—during the part in the script where it’s asking for user input (like Event Name). Then the 'Start' and 'End' fields would plug that date along with the default time(s). 12pm start and 1pm end.
Thanks in advance for the help!
