{"id":2717,"date":"2015-03-24T18:25:25","date_gmt":"2015-03-24T10:25:25","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=2717"},"modified":"2017-12-14T14:30:49","modified_gmt":"2017-12-14T06:30:49","slug":"current-time-toggle-4-3-2","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/current-time-toggle\/current-time-toggle-4-3-2\/","title":{"rendered":"Current Date\/Time Toggle (4.3.2)"},"content":{"rendered":"<p class=\"left-bar\">This article applies to versions 4.3.2 and earlier of P2 Explorer. For help on the latest version of the Current Date\/Time Toggle, see <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/current-time-toggle\/\">Current Date\/Time Toggle<\/a>.<\/p>\n<p class=\"note\">This article describes how to add a Current Date\/Time Toggle control to a page during the page design process. For details on how to use the Current Date\/Time Toggle during run time, see: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/using-the-page-controls\/using-time-pickers\/\">Using Time Pickers<\/a>.<\/p>\n<p class=\"page-subheading\"><\/p>\n<h3 class=\"page-subheading\">Overview<\/h3>\n<p class=\"intro-text\">The Current Date\/Time Toggle provides the user with a check box that allows them to keep the current date\/time on a page, so that the components always display the latest data. The page refreshes at the rate specified in the configuration settings for this component.<\/p>\n<p class=\"intro-text\">The following diagram shows the initial configuration of the Current Date\/Time Toggle:<\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/current.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3314\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/current-800x364.png\" alt=\"current\" width=\"800\" height=\"364\" \/><\/a><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"130\"><strong>Date\/Time<\/strong>:<\/td>\n<td>The date\/time that this component publishes when the check box is selected and every time the page refreshes. This is an event with a date\/time value.<\/td>\n<\/tr>\n<tr>\n<td><strong>Is On<\/strong>:<\/td>\n<td>The event that is published to indicate that the check box has been selected, which means that the time should be set to the current time (now). This is an event with a boolean value.<\/td>\n<\/tr>\n<tr>\n<td><strong>Refresh Rate<\/strong>:<\/td>\n<td>The time, in seconds, after which the page automatically refreshes. The default is 1, which means that the page refreshes every second.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">\u00a0\u00a0<\/p>\n<hr \/>\n<h3 class=\"page-subheading\"><span id=\"Tutorial\">Tutorial<\/span><\/h3>\n<div>\n<p class=\"intro-text\">The Current Date\/Time Toggle is a useful component that enables users to view data at the current time. It is more commonly used with timeseries data than with datasets.<\/p>\n<p class=\"intro-text\">In this tutorial, we\u2019ll look at adding a Current Date\/Time Toggle that will display the Tubing Head Temperature of a well at the current time. The temperature is shown next to the Current Date\/Time Toggle, as follows:<\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3639\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime.png\" alt=\"currentime\" width=\"200\" height=\"75\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime.png 200w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-150x56.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-24x9.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-36x14.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-48x18.png 48w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<p class=\"intro-text\">Let\u2019s go through this process, step-by-step.<\/p>\n<hr \/>\n<h3 class=\"page-subheading\"><span id=\"Step_by_Step_Displaying_a_DateTime_Picker_on_a_Page\"><span id=\"Step_by_Step_Displaying_a_DatasetTable_on_a_Page\"><span id=\"Step_by_Step_Creating_a_Pivot_Table_Driven_by_a_Range_Picker_and_Entity_Selector\"><span id=\"Step_by_Step_Creating_a_Time_Menuthat_Drives_a_LineChart\">Step by Step: Displaying a Current Date\/Time Toggle on a Page\u00a0<\/span><\/span><\/span><\/span><\/h3>\n<p class=\"intro-text\">Before you start, open a new tab in Explorer and click the \u201cCreate a New Page in Studio Mode\u201d thumbnail. Choose the <a title=\"Precision Layout\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/precision-layout\/\">Precision\u00a0Layout<\/a>.<\/p>\n<p class=\"intro-text\">You will need to adjust the configuration to suit your data at your site.<\/p>\n<p class=\"intro-text\"><strong>Step 1. Add the\u00a0source data<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/datetimepickerdata.png\" rel=\"lightbox[2732] lightbox-2\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3633 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/datetimepickerdata-800x534.png\" alt=\"\" width=\"800\" height=\"534\" \/><\/a><\/p>\n<p class=\"intro-text\">Before we can display any\u00a0data on the page, \u00a0we need to add the source data.<\/p>\n<ul class=\"intro-text\">\n<li>Below the canvas, click the button labelled \"<a title=\"Add Data\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/add-data\/\">Add Data<\/a>\".<\/li>\n<li>Choose the data you are going to use. For this tutorial, we are creating\u00a0a <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/add-data\/add-time-series-data\/\">time series\u00a0dataset<\/a>, so select <em>Model<\/em> and then click \u201cAdd\u201d.<\/li>\n<li>In the configuration options, specify the following:\n<ul class=\"intro-text\">\n<li>Name: THTemp<\/li>\n<li>Using: Entities<\/li>\n<li>Entities: (List) Earl<\/li>\n<li>Template: Oil Producing Well<\/li>\n<li>Attribute: THT!Actual (click <strong>Add<\/strong> after selecting the attribute)<\/li>\n<li>Group By: None<\/li>\n<li>SampleInterval: (Number) 86400<\/li>\n<li>SampleMethod: (Text) Average<\/li>\n<li>StartTime: (Event) time<\/li>\n<li>EndTime: (Event) time<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"intro-text\">In this example, we are going to use the same start time and end time, because we want to display the value at the current\u00a0time.\u00a0<\/p>\n<p class=\"intro-text\"><strong>Step 2.\u00a0\u00a0Add the Current Date\/Time Toggle to the page<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentdrag.png\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3640\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentdrag-800x450.png\" alt=\"currentdrag\" width=\"800\" height=\"450\" \/><\/a><\/p>\n<p class=\"intro-text\">Drag and drop the Current Date\/Time Toggle component\u00a0onto the page, and resize it appropriately using the drag handles.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\"><strong>Step 3. Configure the Current Date\/Time Toggle component<\/strong>\u00a0<\/p>\n<\/div>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentconfig.png\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3641\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentconfig.png\" alt=\"currentconfig\" width=\"702\" height=\"291\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentconfig.png 702w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentconfig-150x62.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentconfig-24x10.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentconfig-36x15.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentconfig-48x20.png 48w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/a><\/p>\n<p class=\"intro-text\">Use the defaults, as follows:<\/p>\n<ul class=\"intro-text\">\n<li>Date\/Time: time<\/li>\n<li>Is On: isNow<\/li>\n<li>Refresh Rate: (Number) 1<\/li>\n<\/ul>\n<p class=\"intro-text\">This event will feed the time into the dataset that we previously added. If you now switch to the dataset added in Step 1 and click the Preview button, you will see the value refresh every second.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<div>\n<p class=\"intro-text\"><strong>Step 4. Add and configure a Data Label<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentdata.png\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3642\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentdata-800x451.png\" alt=\"currentdata\" width=\"800\" height=\"451\" \/><\/a><\/p>\n<\/div>\n<p class=\"intro-text\">Add a <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/data-label\/\">Data Label<\/a> component to the page and configure it as follows:<\/p>\n<ul class=\"intro-text\">\n<li>Source Data: THTemp<\/li>\n<li>Value Column: (Text) Value<\/li>\n<li>Decimals: (Number) 2<\/li>\n<\/ul>\n<p class=\"intro-text\">\u00a0<\/p>\n<div>\n<p class=\"intro-text\"><strong>Step 5. All done!\u00a0\u00a0<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3639\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime.png\" alt=\"currentime\" width=\"200\" height=\"75\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime.png 200w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-150x56.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-24x9.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-36x14.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/currentime-48x18.png 48w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<p class=\"intro-text\">Great work! You now have a fully functioning Current Date\/Time Toggle that displays the Tubing Head temperature of a well at the current time. The value refreshes every second.<\/p>\n<ul class=\"intro-text\">\n<li>Click the preview\u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/preview.png\" rel=\"lightbox[1419] lightbox-7\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2896\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/preview.png\" alt=\"preview\" width=\"13\" height=\"14\" \/><\/a>\u00a0button on the Studio toolbar\u00a0to see what your page\u00a0will look like in run-time.<\/li>\n<li>Click the check box to select and unselect the time, and observe the difference to the temperature value.<\/li>\n<\/ul>\n<p class=\"intro-text\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1348\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save.png\" alt=\"save\" width=\"48\" height=\"53\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save.png 48w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save-22x24.png 22w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save-33x36.png 33w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save-43x48.png 43w\" sizes=\"auto, (max-width: 48px) 100vw, 48px\" \/>\u00a0Don\u2019t forget to <a title=\"Saving Your Page\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-create-your-first-page\/saving-your-page\/\">save your page<\/a>!<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Current Date\/Time Toggle provides the user with a check box that allows them to keep the current date\/time on a page, so that the components always display the latest data. The page refreshes at the rate specified in the configuration settings for this component. This tutorial guides you through an example of how to use the Current Date\/Time Toggle. This tutorial applies to versions 4.3.2 and earlier of P2 Explorer.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/current-time-toggle\/current-time-toggle-4-3-2\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":4662,"parent":13119,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[11],"tags":[154],"class_list":["post-2717","page","type-page","status-publish","has-post-thumbnail","hentry","category-tutorial","tag-time","Product-ex"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/2717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=2717"}],"version-history":[{"count":0,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/2717\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/13119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/4662"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=2717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=2717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=2717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}