Skip to content

calendar.js: how to specify the date AND time? #5

@srustamo

Description

@srustamo

In file: https://github.com/mementodatabase/scripts/blob/master/android/calendar.js
@param {Arguments} options for date AND time are not clear.

I have three field in my database:
DT - date
TM - time
EN - end time

I want to run a trigger to add an event into Android calendar with date as "DT", beginning time as "TM" and end time as "EN".

So far I'm able to either set a date with
AndroidCalendar.create( entry().field("Title") , {begin:new Date(), allDay:true});
Or time with
AndroidCalendar.create( entry().field("Title") , {begin:entry().field("TM"), allDay:false});
When setting the time, the date field in Android calendar defaults to 1970.

How do I set both date and time referencing "DT" and "TM" fields?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions