Jump to content
  • 0

Datetime Display - Date Only Or Date And Time


LWSChad

Question

Hello All!!

 

I have a date field in which times are captured and stored some of the time.  I am trying to figure out how to display the date in an HTML block in a dynamic way that displays time if present and not if empty.

 

Please consider:

Date1:  01/06/2015

Date2:  01/07/2015 17:45:00

 

Desired display:

Date1: Jan 6th, 2015

Date2: Jan 7th, 2015 5:45PM

 

Actual display

Date1: Jan 6th, 2015 12:00AM

Date2: Jan 7th, 2015 5:45PM

 

When time is not captured it is not relevant and thus shouldn't be displayed.

 

I have a workaround that involves a calculated field, but it's pretty clunky.

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Iren;

Thanks that is closer, but without any formatting the dates are displayed as:

 

Date1:  01/06/2015

Date2:  01/07/2015 17:45:00

 

Desired display:

Date1: Jan 6th, 2015

Date2: Jan 7th, 2015 5:45PM

 

It may seem like a minor difference, but my users will be using this app for hours at a time (some for the majority of a work day), and the former display is harder to read.

 

FEI (For everyone's information) that calculated field.

Replace([@cbField],' 12:00AM','')
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...