Skip to content

fix and improve timezone related functions#16

Open
automationai wants to merge 1 commit into
pixelcog:masterfrom
automationai:hotfix-timezone
Open

fix and improve timezone related functions#16
automationai wants to merge 1 commit into
pixelcog:masterfrom
automationai:hotfix-timezone

Conversation

@automationai

Copy link
Copy Markdown

get the default timezone via CalendarApp to fix the issue
change the 1st param of formatDate() from 'message' to 'date' unlock the limitation

get the default timezone via CalendarApp to fix the issue
change the 1st param of formatDate() from 'message' to 'date' unlock the limitation
Comment thread GmailUtils.gs
* @return {string} Formatted date
*/
function formatDate(message, format, timezone) {
function formatDate(date, format, timezone) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change from 'message' to 'date' to unlock the limitation

Comment thread GmailUtils.gs
function localTimezone_() {
var timezone = new Date().toTimeString().match(/\(([a-z0-9]+)\)/i);
return timezone.length ? timezone[1] : 'GMT';
var timezone = CalendarApp.getDefaultCalendar().getTimeZone();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CalendarApp to get default timezone to fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant