Skip to content

Option for choosing the Date format #177

Open
julien040/notionapi-anyquery-fork
#1
@katyatitkova

Description

@katyatitkova

The Date type currently includes the time as part of the date:

type Date time.Time

func (d *Date) String() string {
	return time.Time(*d).Format(time.RFC3339)
}

func (d Date) MarshalText() ([]byte, error) {
	return []byte(d.String()), nil
}

As a result, all Date properties filled using notionapi will have the time part visible in the Notion UI (until the user manually turns off the "Include time" option for that property on a particular page).

When I change time.RFC3339 to "2006-01-02" locally, only the date part is sent, and only the date part is visible in the Notion UI.

Would it be possible to add an option to choose the date format that is sent to Notion? This would allow users to select whether they want to include the time or not. I don't have much experience with Go, so I'm wondering if it's possible to make this change in a backward-compatible manner. If it's not, then I can continue to use my forked version.

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