-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding setTimezone #843
Open
hmonika23
wants to merge
8
commits into
master
Choose a base branch
from
settimezonepage_localedropdown
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
adding setTimezone #843
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
78d6c13
adding setTimezone
hmonika23 85b548c
Made the changes suggested by ritu
hmonika23 db30df5
filename changed
hmonika23 072adf8
changed filename to settimezone-method
hmonika23 ade77c9
Test issue For application level
hmonika23 4c37638
Update settimezone-method.md
hmonika23 5f056e3
Delete settimezone-function.md
hmonika23 c6619d1
Update settimezone-method.md
hmonika23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: "Setting Time Zone for Datetime widget " | ||
id: "settimezone-method" | ||
--- | ||
|
||
The setTimezone method allows precise adjustment of time to specific time zones, ensuring accuracy and consistency in date and time displays. | ||
|
||
## Using setTimezone for Datetime widget | ||
|
||
1. Drag and drop a Datetime widget. [learn more about Datetime](/learn/app-development/widgets/form-widgets/date-time-datetime/#datetime-properties) | ||
![datetime_widget.png](/learn/assets/datetime_widget.png) | ||
|
||
2. From the properties panel, set default date to **CURRENT_DATE**: | ||
|
||
![current_date_default_value.png](/learn/assets/current_date_default_value.png) | ||
3. From Datetime widget events tab, set **On Before Load** event to JavaScript. | ||
|
||
![js_event.png](/learn/assets/js_event.png) | ||
4. After redirecting to the script, add the below code to set Timezone of the datetime widget to the specified timezone. | ||
``` Javascript | ||
Page.datetime1Beforeload = function($event, widget) { | ||
Page.Widgets.datetime2.setTimezone({ | ||
'timezone': 'Pacific/Kiritimati' | ||
}); | ||
}; | ||
|
||
``` | ||
![script_screenshot.png](/learn/assets/script_screenshot.png) | ||
|
||
## For Application Level | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test error: heading-start-left/header-start-left Headings must start at the beginning of the line [Context: " ## For Application Level"] |
||
In App.js write the below script. Using this script, the specified timezone will be used across all time-related widgets within the application. | ||
|
||
|
||
``` Javascript | ||
App.onPageReady = function(activePageName, activePageScope, $activePageEl) { | ||
App.setTimezone({ | ||
'timezone': 'Pacific/Kiritimati' | ||
}); | ||
} | ||
``` | ||
|
||
![app_js_script.png](/learn/assets/app_js_script.png) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
![timedifference.png](/learn/assets/timedifference.png) | ||
|
||
|
||
|
||
:::note | ||
|
||
The procedure is same for Date and Time widget. | ||
::: | ||
|
||
:::note | ||
|
||
For Date widget the implementation will work from 11.4.2 version. | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: "Setting Time Zone for Datetime widget " | ||
id: "settimezone-method" | ||
--- | ||
|
||
The setTimezone method allows precise adjustment of time to specific time zones, ensuring accuracy and consistency in date and time displays. | ||
|
||
## Using setTimezone for Datetime widget | ||
|
||
1. Drag and drop a Datetime widget. [learn more about Datetime](/learn/app-development/widgets/form-widgets/date-time-datetime/#datetime-properties) | ||
![datetime_widget.png](/learn/assets/datetime_widget.png) | ||
|
||
2. From the properties panel, set default date to **CURRENT_DATE**: | ||
|
||
![current_date_default_value.png](/learn/assets/current_date_default_value.png) | ||
3. From Datetime widget events tab, set **On Before Load** event to JavaScript. | ||
|
||
![js_event.png](/learn/assets/js_event.png) | ||
4. After redirecting to the script, add the below code to set Timezone of the datetime widget to the specified timezone. | ||
``` Javascript | ||
Page.datetime1Beforeload = function($event, widget) { | ||
Page.Widgets.datetime2.setTimezone({ | ||
'timezone': 'Pacific/Kiritimati' | ||
}); | ||
}; | ||
|
||
``` | ||
![script_screenshot.png](/learn/assets/script_screenshot.png) | ||
|
||
## For Application Level | ||
In App.js write the below script. Using this script, the specified timezone will be used across all time-related widgets within the application. | ||
|
||
|
||
``` Javascript | ||
App.onPageReady = function(activePageName, activePageScope, $activePageEl) { | ||
App.setTimezone({ | ||
'timezone': 'Pacific/Kiritimati' | ||
}); | ||
} | ||
``` | ||
|
||
![app_js_script.png](/learn/assets/app_js_script.png) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
![timedifference.png](/learn/assets/timedifference.png) | ||
|
||
|
||
|
||
:::note | ||
|
||
The procedure is same for Date and Time widget. | ||
::: | ||
|
||
:::note | ||
|
||
For Date widget the implementation will work from 11.4.2 version. | ||
|
||
::: |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test issue: header-start-left Headings must start at the beginning of the line [Context: " ## For Application Level"]