Alpha DevCon 2018
Results 1 to 3 of 3

Thread: How to format date field in a formview

  1. #1
    Member
    Real Name
    Doug Evenhouse
    Join Date
    Apr 2009
    Posts
    47

    Default How to format date field in a formview

    Hi,

    I have a datetime field in a list control that I want to display and edit in a formview. In the list control "Client-side" properties for the field I have "Date/time display format" set to "<Default - date portion only>." However in the formview this date field is shown with the time component (see attached screenshot). I can't find any properties in the Formview that would let me control the formatting for the date. Should the Formview respect the client-side property setting for "Date/time display format"? Any direction as to how can I attack this problem?

    Thanks.

    -Doug

    AATablet_Date_Formatting.PNG

  2. #2
    Alpha Software Employee Beta Spark's Avatar
    Real Name
    Sarah Mitchell
    Join Date
    Jul 2015
    Posts
    388

    Default Re: How to format date field in a formview

    Quote Originally Posted by dougeven View Post
    Hi,

    I have a datetime field in a list control that I want to display and edit in a formview. In the list control "Client-side" properties for the field I have "Date/time display format" set to "<Default - date portion only>." However in the formview this date field is shown with the time component (see attached screenshot). I can't find any properties in the Formview that would let me control the formatting for the date. Should the Formview respect the client-side property setting for "Date/time display format"? Any direction as to how can I attack this problem?

    Thanks.

    -Doug

    AATablet_Date_Formatting.PNG
    Great question, Doug!

    You could use client-side templates for your field for displaying the date. All the data in the FormView are string (ie, character) types. Based on the image, you could apply the date format directive like so:

    Code:
    {MyFieldName:dateString('MM/dd/yyyy&&0h:0m:0s am','MM/dd/yyyy')}
    There is a date format directive builder available in the List control. You can also access it from the Template Tester - an option for opening the Template Tester is available from the Web Projects Control Panel in the 'Tools' menu.
    Sarah Mitchell

    Looking for answers? Try our documentation.
    If you can't find something, let us know!

  3. #3
    Member
    Real Name
    Doug Evenhouse
    Join Date
    Apr 2009
    Posts
    47

    Default Re: How to format date field in a formview

    Thank you. I did not know about date format directives.

Similar Threads

  1. Duplicate record with date field and keep date format
    By J.R. Noe in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 06-27-2014, 04:46 PM
  2. How to format a variable to update a date field
    By betty in forum Alpha Five Version 10 - Desktop Applications
    Replies: 7
    Last Post: 09-12-2010, 10:08 AM
  3. Change Date field from a character format to a Date format
    By Billn in forum Alpha Five Version 10 - Desktop Applications
    Replies: 11
    Last Post: 07-18-2010, 12:11 PM
  4. Convert a time field to date only format
    By leufj in forum Alpha Five Version 9 - Desktop Applications
    Replies: 0
    Last Post: 08-26-2009, 11:07 AM
  5. Convert Numeric8 field to a Date format field
    By dchiass in forum Alpha Five Version 7
    Replies: 3
    Last Post: 09-07-2006, 11:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •