{"id":1413,"date":"2015-02-12T16:46:35","date_gmt":"2015-02-12T08:46:35","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=1413"},"modified":"2017-12-14T14:32:30","modified_gmt":"2017-12-14T06:32:30","slug":"date-picker-4-3-2","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/date-picker\/date-picker-4-3-2\/","title":{"rendered":"Date Picker (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 date picker, see <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/date-picker\/\">Date Picker<\/a>.<\/p>\n<p class=\"note\">This article describes how to add a Date Picker control to a page during the page design process. For details on how to use the Date Picker\u00a0during 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\n<h3 class=\"page-subheading\">Overview<\/h3>\n<p class=\"intro-text\">The Date Picker is used to select a date for which to retrieve data. The date is usually a 24-hour time\u00a0range (midnight to midnight), but can be configured to start and end at a different time (e.g. 1am to 1am), or can even be shorter than 24 hours (e.g. 1am to 1pm).<\/p>\n<p class=\"intro-text\">The following diagram shows a typical Date Picker being configured:<\/p>\n<div style=\"position: relative;\">\u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2177\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig-800x377.png\" alt=\"datepickerconfig\" width=\"800\" height=\"377\" \/><\/a><\/div>\n<table>\n<tbody>\n<tr>\n<td width=\"130\"><strong>Start Date<\/strong>:<\/td>\n<td>The date that is displayed on the control in live mode, representing the beginning of the time range. This is used to set the date on the control when the page is first loaded. You can choose the date and time separately, however it's normally used to specify a time period of midnight-midnight. If defined as an event, Start Date can both publish the event or\u00a0subscribe to an event.<\/td>\n<\/tr>\n<tr>\n<td><strong>End Date<\/strong>:<\/td>\n<td>The finish of the date range, which should be at most 24 hours after the start date. If this is more than 24 hours from the start date, the end date is ignored and it defaults to 24 hours later.\u00a0If defined as an event, End\u00a0Date can both publish the event or\u00a0subscribe to an event.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<hr \/>\n<h3 class=\"page-subheading\">Tutorial<\/h3>\n<p class=\"intro-text\">The Date\u00a0Picker is a useful control that enables users to change the type of data that is returned to other controls on a page.<\/p>\n<p class=\"intro-text\">In this tutorial, we'll look at adding a Date\u00a0Picker that will change what is displayed on a chart as the user selects different dates.<\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2179\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive.png\" alt=\"datepickerlive\" width=\"397\" height=\"319\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive.png 397w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-150x121.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-24x19.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-36x29.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-48x39.png 48w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/a><\/p>\n<p class=\"intro-text\">Let's go through this process, step-by-step.<\/p>\n<hr \/>\n<h3 class=\"page-subheading\">Step by Step: Creating a Date\u00a0Picker that Drives a Line\u00a0Chart<\/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=\"Grid Layout\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/grid-layout\/\">grid<\/a>\u00a0layout - you can adjust the rows and columns if you like but it's not important for this exercise.<\/p>\n<p class=\"intro-text\">If you have access to the training environment, you can follow the steps exactly as outlined here. Otherwise, you will need to adjust the configuration to suit your data.<\/p>\n<p class=\"intro-text\"><strong>Step 1. Add the Date\u00a0Picker to the page<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerdrag1.png\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3158 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerdrag1-800x486.png\" alt=\"\" width=\"800\" height=\"486\" \/><\/a><\/p>\n<p class=\"intro-text\">Drag and drop the Date\u00a0Picker\u00a0control onto a grid cell.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\"><strong>Step 2.\u00a0\u00a0Configure the Date\u00a0Picker<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig3.png\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3159 size-full\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig3.png\" alt=\"\" width=\"748\" height=\"239\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig3.png 748w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig3-150x48.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig3-24x8.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig3-36x12.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerconfig3-48x15.png 48w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/a><\/p>\n<p class=\"intro-text\">By default, the Date\u00a0Picker uses events to configure all its options. In fact, you'll notice that the\u00a0events all come preconfigured with event names. This is because these events are so often used, and by other controls on the page, that it's often unnecessary to bother changing the names.<\/p>\n<p class=\"intro-text\">It's best to leave the names as is, but you can change them if you want. If you do change them, you'll need to remember this for the next steps.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\"><strong>Step 3.\u00a0\u00a0Create the events<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerevents1.png\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3160 size-full\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerevents1.png\" alt=\"\" width=\"747\" height=\"378\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerevents1.png 747w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerevents1-150x76.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerevents1-24x12.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerevents1-36x18.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerevents1-48x24.png 48w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/a><\/p>\n<p class=\"intro-text\">This step provides the hooks for the Date\u00a0Picker to send and receive signals (<a title=\"Events\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/events\/\">events<\/a>) to and from other controls on the page.<\/p>\n<ul class=\"intro-text\">\n<li>Click the <em><strong>Event Defaults<\/strong><\/em> button on the far right side of the Studio toolbar.<\/li>\n<li>Create\u00a0an event called <em>\"startTime\"<\/em>\u00a0with a datetime set to 4 December 2012.<\/li>\n<li>Create an event called <em>\"endTime\"<\/em> with a datetime set to 5 December 2012.<\/li>\n<\/ul>\n<p class=\"intro-text\">You can create an\u00a0event at any time. In creating these events, we make them available not only to the Date\u00a0Picker, but also to any other controls we may want to place on the page.<\/p>\n<p>Click the preview\u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/preview.png\" rel=\"lightbox[1419] lightbox-5\"><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 to see what your page will look like in run-time. Observe that the Date\u00a0Picker displays a calendar starting at 4 December 2012.<\/p>\n<p>&nbsp;<\/p>\n<p class=\"intro-text\"><strong>Step 4. Add and Configure Source Data<\/strong><\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerdataset.png\" rel=\"lightbox-6\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2190 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerdataset-751x600.png\" alt=\"datepickerdataset\" width=\"751\" height=\"600\" \/><\/a><\/p>\n<p class=\"intro-text\">Date\u00a0Pickers don't normally do anything by themselves - you use them to drive other controls.\u00a0Ultimately, we want the Date\u00a0Picker to change the returned data depending on what\u00a0date\u00a0the user selects. Click the preview\u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/preview.png\" rel=\"lightbox[1419] lightbox-5\"><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 again to switch back to edit mode, and add some data\u00a0that we will use to return data to a chart.<\/p>\n<ul class=\"intro-text\">\n<li>Add the <em>ProductionValuesTrend_Perth<\/em>\u00a0dataset, and configure it as follows:\n<ul class=\"intro-text\">\n<li>typeTemplate: (Text)\u00a0Completion<\/li>\n<li>names: (List)\u00a0BOSSIER 1-1<\/li>\n<li>readingType: (Text)\u00a0Daily<\/li>\n<li>prodStartTime:\u00a0(Event)\u00a0startTime<\/li>\n<li>prodEndTime: (Event) endTime<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"intro-text\">As you can see, you need a degree of familiarity with the dataset to know what the parameters mean. In this dataset, we have 2 parameters that can listen to events published by the Date\u00a0Picker: <strong>prodStartTime<\/strong>\u00a0and <strong>prodEndTime.<\/strong> This is what ultimately causes the chart to change when the user selects different dates.<\/p>\n<p>&nbsp;<\/p>\n<p class=\"intro-text\"><strong>Step 5. Add and configure the chart<\/strong><\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerchartconfig2.png\" rel=\"lightbox-8\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3164 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerchartconfig2-518x600.png\" alt=\"\" width=\"518\" height=\"600\" \/><\/a><\/p>\n<p class=\"intro-text\">Let's add a <a title=\"Charts\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/charts\/\">chart<\/a>\u00a0that will make use of the Date\u00a0Picker. Drag and drop a Chart\u00a0onto another cell on the page. Configure the <a title=\"Line Chart\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/charts\/\">line chart<\/a> as follows:<\/p>\n<ul class=\"intro-text\">\n<li>Source Data:\u00a0ProductionValuesTrend_Perth1<\/li>\n<li>For the chart series:\n<ul class=\"intro-text\">\n<li>Type: Line\u00a0series<\/li>\n<li>Y Column: (Text)\u00a0OIL<\/li>\n<li>Name: (Text)\u00a0Oil<\/li>\n<li>Colour: (Text)\u00a0#80C466<\/li>\n<\/ul>\n<\/li>\n<li>For the X Axis:\n<ul class=\"intro-text\">\n<li>Column: (Text)\u00a0PROD_DATE<\/li>\n<li>Data Type: Time<\/li>\n<li>Min: (event) StartTime<\/li>\n<li>Max: (event) EndTime<\/li>\n<li>Ticks: 5<\/li>\n<\/ul>\n<\/li>\n<li>For the Left Y Axis:\n<ul class=\"intro-text\">\n<li>Enable Gridlines: No<\/li>\n<li>Ticks: 3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p class=\"intro-text\"><strong>Step 4. All Done!\u00a0\u00a0<\/strong><\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2179 size-full\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive.png\" alt=\"datepickerlive\" width=\"397\" height=\"319\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive.png 397w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-150x121.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-24x19.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-36x29.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/datepickerlive-48x39.png 48w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/a><\/p>\n<p class=\"intro-text\">Congratulations! You now have a fully functioning Date\u00a0Picker\u00a0that drives a line\u00a0chart.\u00a0<\/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-5\"><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 to see what your page will look like in run-time.<\/li>\n<li>When the Date Picker\u00a0first loads, the chart displays data for the corresponding default date.<\/li>\n<li>Try changing the date to see what happens.<\/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't 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<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Date Picker is used to select a date for which to retrieve data. The date is usually a 24-hour time range (midnight to midnight), but can be configured to start and end at a different time (e.g. 1am to 1am), or can even be shorter than 24 hours (e.g. 1am to 1pm). This article describes how to add a Date Picker control to a page during the page design process, and 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\/date-picker\/date-picker-4-3-2\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":4505,"parent":13123,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[11],"tags":[348],"class_list":["post-1413","page","type-page","status-publish","has-post-thumbnail","hentry","category-tutorial","tag-date-and-time-pickers","Product-ex"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/1413","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=1413"}],"version-history":[{"count":0,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/1413\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/13123"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/4505"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=1413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=1413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=1413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}