Differences

This shows you the differences between two versions of the page.

Link to this comparison view

field type - date [2016/09/14 14:19] (current)
Line 1: Line 1:
 +====== Date ======
 +The date field stores a date.  Internally, the stored value for all date/time fields is a timestamp which equals the number of seconds elapsed from January 1, 1970 to the time specified, which for a date field is 12:00 AM on the day specified. ​ Outwardly, though, it appears as a calendar date.  The display of this field is affected by [[Timezone and Locale|Timezone and Locale]] settings.
  
 +
 +===== How to Create =====
 +  - Click the {{:​presentation-layer:​field-plus.png|}} to add a field in your [[Form|form]].
 +  - Choose "New Field"
 +  - Select the table you wish to add the field to. Most of the time, this will be the current [[Table|table]] you are on, called the current [[Context|context]].
 +  - Select a field name and click "​Choose Type".
 +  - Choose "​Date"​ from the list of field types.
 +  - You can continue adding fields or click the "​Select"​ button to finish adding.
 +
 +===== Features =====
 +Field features can be edited by clicking on the orange field icon {{:​date.png|}} when the [[Presentation Layer|presentation layer]] is displayed. ​
 +
 +==== Field Label ====
 +  * [[Field Setting - Field Label|Field Label]]
 +  * [[Field Setting - Display Alternate Label]] (affects this form only)
 +
 +==== Grid Appearance ====
 +
 +  * [[Field Setting - Column Span|Column Span]]
 +  * [[Field Setting - Row Span|Row Span]]
 +  ​
 +==== Tooltip ====
 +  * [[Field Setting - Tooltip|Tooltip]]
 +  * [[Field Setting - Descriptive Text|Descriptive Text]]
 +  * [[Field Setting - Display Alternate Descriptive Text|Display Alternate Descriptive Text]] (affects this form only)
 +  ​
 +==== Field Format ====
 +  * [[Application Setting - Date Format for all Date and Date Time Fields|Date Format for all Date and Date Time Fields]]
 +  * [[Field Setting - Specify a Date Format|Specify a Date Format]]
 +  * [[Field Setting - Specify Alternate Date Format|Specify Alternate Date Format]] (affects this form only)
 +  * [[Field Setting - Sizing|Length]]
 +
 +==== Block Association ====
 +  * [[Field Setting - Temporary Block Association|Temporary Block Association]]
 +  * [[Field Setting - Global Block Association|Global Block Association]]
 +
 +==== Default Value ====
 +  * [[Field Setting - Default Value|Default Value]]
 + 
 +==== Validation ====
 +   * [[Field Setting - Required|Required]]
 +
 +==== Audit History ====
 +  * [[Field Setting - Audit This Field|Audit This Field]] ​
 +  * [[Field Setting - Show Audit History|Show Audit History]]
 +
 +==== View Only ====
 +  * [[Field Setting - View Only|View Only]]
 +  ​
 +===== Output Formats =====
 +The date Field has 25 different output formats. ​ The following are examples of output when 09/09/2009 is stored in a date Field:
 +
 +  * Full Field - 09/09/2009
 +  * WX Stored Value - 1252468800 ​  (The number of seconds from January 1, 1970 to the 12:00 AM of the stored day)
 +  * AM/PM Lowercase - am   ​(Since 12:00 AM is actually the time that's stored)
 +  * AM/PM Uppercase - AM
 +  * Day of the Month - 9
 +  * Day of the Month Suffix - th   (For use in expressions such as 'The 9th of September, 2009')
 +  * Day of the Month With Leading Zero - 09
 +  * Day of the Week - Wednesday
 +  * Day of the Week Abbreviated - Wed
 +  * Day of the Week Number - 3  (The number that Wednesday takes as a day of the week, with Monday as 1)
 +  * Day of the Year - 252
 +  * Hour - 12
 +  * Hour 24 - 0
 +  * Hour 24 With Leading Zero - 00
 +  * Hour With Leading Zero - 12
 +  * Minute - 0
 +  * Month Name - September
 +  * Month Name Abbreviated - Sep
 +  * Month - 9
 +  * Month With Leading Zero - 09
 +  * Second - 0   (This return type is only useful when NOW() or a literal number is set to a Date and Time field through actions).
 +  * Timestamp - 1252468800 ​  (Same as WX Stored Value)
 +  * Week of the Year - 37   ​(Returns the sequential number of the week in which the time falls)
 +  * Year 4 Digit - 2009
 +  * Year 2 Digit - 09
 +===== Acceptable inputs =====
 +Though a date is stored internally as a number, when interacting with the Field on a page, you must input a date through the calendar flyout. ​
 +
 +The Calendar Flyout
 +
 +Setting the date is done by clicking on the date part of the Field and clicking on a day from the calendar flyout which will appear. ​
 +
 +  * Navigating between months is done by using the <Prev and Next> links or by using the month drop-down for selecting the month explicitly. ​
 +  * The year can be selected by using the year drop-down. ​
 +  * The Today link in the midde of the top of the calendar flyout selects the current day.
 +  * The Clear link in the bottom left corner of the calendar flyout clears the currently selected day and closes the calendar flyout
 +  * The Close link in the bottom right corner closes the calendar flyout.
 +  * Clicking a day's symbol (Su, Mo, etc) near the top of the flyout reorganizes the calendar with that day as the first day of the week.
 +
 +==== Setting With Actions ====
 +
 +When setting the Date field through actions, two different input formats may be used.  As with other field types, the stored value from another Date field may be used to save into a Date field. ​ Since the stored value for these fields is a timestamp, any timestamp value may also be used to save into a Date field (may be calculated from an expression or extracted from a Date & Time or Time field).
 +
 +In addition to this, the text output of the Date field (e.g. 04/23/1985) may also be used to save into the Date field. ​ Because of this, you may also construct such a text string and use it to save into the Date field. ​ For instance, if I wanted to set a Date field with a date seven days after the date saved in a different Date field, I could use the arithmetic function to add 7 to the Day of the Month output, and set the mm/dd/yyyy format into the target field.
 +
 +Ex. Suppose you have a Date field called Task Date and another Date field called Callback Date on an item called Task and you needed to set the callback date to exactly one week after the Task Date.  To do this, you could set the expression ${Task - Task Date (Month)}/​+=(${Task - Task Date (Day of the Month)}+7)/​${Task - Task Date (Year 4 Digit)} into the Callback Date field.
 +
 +===== Filters =====
 +The date field can be filtered with any of the [[Query Builder - Filter#​Time-type filters|time-type filters]].
 +
 +===== Internationalization and Browser Settings =====
 +Date and Time settings should change automatically in non-US countries. For more information,​ read the [[Field Setting - Regionalization|Regionalization Field Settings]] page, or if you need to change your settings manually to simulate being in another country, [[Browser Settings - Date and Time|try out these settings]].
field type - date.txt ยท Last modified: 2016/09/14 14:19 (external edit)
Copyright WorkXpress, 2019