<div class="aw-data-item">
<b>{Subject}</b> by {sc_CreatedBy} on {CreatedOn}
</div>
The date displays 27-09-2018
but that format isn't used in any of my Date attributes.
Isn't there a way to format this using an @ sign or something.
Like this... {CreatedOn,@MM/dd/yy}
How can I format a Date in a HTML custom layout template?
How can I format a Date in a HTML custom layout template?
Last edited by Jaymer on Sun Sep 30, 2018 6:45 pm, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: How to format a Date in a HTML custom layout template
When you are using HTML on forms it is <<BO.CreatedOn, MM/dd/yy>> no @ sign (though I prefer the Dutch name for it: "monkey tail")Jaymer wrote:<div class="aw-data-item">
<b>{Subject}</b> by {sc_CreatedBy} on {CreatedOn}
</div>
The date displays 27-09-2018
but that format isn't used in any of my Date attributes.
Isn't there a way to format this using an @ sign or something.
Like this... {CreatedOn,@MM/dd/yy}
Re: How to format a Date in a HTML custom layout template
still need a solution.
this is in a custom layout template where << >> are NOT used
thx
jaymer...
this is in a custom layout template where << >> are NOT used
thx
jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: How to format a Date in a HTML custom layout template
why not just create a new computed field (text) that has a rule to format the date the way you want it displayed and use that field on the form.
Bruce
Bruce
Re: How to format a Date in a HTML custom layout template
Silly question, Jaymer, but did you put M/dd/yy in the Format section of the Date attribute you are trying to display in the query?
Tom - V8.8 build 3137 - MySql / PostGres
Re: How to format a Date in a HTML custom layout template
Good questions and suggestions guys, but you're missing the boat.
See the pics below and you'll see where this is used.
Thanks!
Definition of the Field: Its for a Combo Box on a form, to pretty the dropdown options: Result looks like this:
See the pics below and you'll see where this is used.
Thanks!
Definition of the Field: Its for a Combo Box on a form, to pretty the dropdown options: Result looks like this:
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: How to format a Date in a HTML custom layout template
This is from a Custom Query, and it CORRECTLY used a Format associated with the Attribute to format the Date.
Must be a bug in the Custom List code.
THIS: Event Date: <b>{TransDate, @MM/dd/yy}</b></br> did not work. Output was the same.
THIS: Event Date: <b>{TransDate,@MM/dd/yy}</b></br> threw an error for unknown field when trying to Save template.
But the Question is still valid:
In this Custom Query, how would you format the Timestamp field to ONLY show the Date and NOT the time?
Custom Query snippet:
Must be a bug in the Custom List code.
THIS: Event Date: <b>{TransDate, @MM/dd/yy}</b></br> did not work. Output was the same.
THIS: Event Date: <b>{TransDate,@MM/dd/yy}</b></br> threw an error for unknown field when trying to Save template.
But the Question is still valid:
In this Custom Query, how would you format the Timestamp field to ONLY show the Date and NOT the time?
Custom Query snippet:
Code: Select all
<div class="aw-data-item">
Event Date: <b>{TransDate}</b></br>
Type: <b>{TransType}</b></br>
Descr:: <b>{Descr}</b></br>
Message: <b></b></br>
Opened: <b>{xOpened}</b> Clicked: <b>{xClicked}</b> Bounced: <b>{xBounce}</b></br>
</div>
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: How can I format a Date in a HTML custom layout template
This is what you can do:
# var d = kendo.parseDate (data["NameOfYourDateOrTimestampAttribute"], "MM/dd/yyyy HH:mm"); #
# var s = kendo.toString (d, "MMM dd yyyy"); #
<span>
#= s #
</span>
# var d = kendo.parseDate (data["NameOfYourDateOrTimestampAttribute"], "MM/dd/yyyy HH:mm"); #
# var s = kendo.toString (d, "MMM dd yyyy"); #
<span>
#= s #
</span>
Aware IM Support Team
Re: How can I format a Date in a HTML custom layout template
thanks - this is a great help
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL