I'm using Pentaho Report Designer 3.9.3 and I'm looking for a way to format the font weight, size, and color of each data type within a message field. My message field is as follows.
USAGE FROM $(MAX_DATE, date, MMMM dd) TO $(MIN_DATE, date, MMMM dd)
Which gives the output: USAGE FROM December 09 TO December 15
I would like to format the message field as follows: USAGE FROM December 09 TO December 15 (with December 09 and December 15 having a red font color in regular text)
I'm not sure how to accomplish that without breaking up message fields and combining them. I'm sure that there is a better way to handle that. Your assistance is appreciated.
An alternative way to achieve this result is to use a message-field and insert html with font size and style that you desire.
<html>
<body>
<span style="color:#333333"><B>USAGE FROM</B></span>
<B><span style="color:red;font-size:16pt">$(MIN_DATE, date, MMMM d)</B>
<B><span style="color:#333333">TO</span></B>
<B><span style="color:red;font-size:16pt"> $(MAX_DATE, date, MMMM d)</span></B>
</body>
</html>
Change the "rich-text-type of the message-field to "text/html" and that will give you the desired output.
Related
The date in my Invoice is currently showing as:
21/11/2014 16:59:15
I want to show just month something like this:
11
I tried using t-esc with strftime but that doesn't work:
<span t-esc="o.date_order.strftime('%m')" />
Try:
<span t-field="o.date_order" t-field-options='{"format": "MM"}'/>
More on supported format patterns.
Try This.
<span t-esc="datetime.datetime.strptime(o.sale_id.confirmation_date, '%Y-%m-%d %H:%M:%S').strftime('%B %d,%Y')"/>
My Output is: May 28,2018
Hope, It will be use.
I have a sfdatepicker in my windows app project
but when i use it the SfDateSelector appears in american format, and i want to change it to european (day/month/year)
<Syncfusion:SfDatePicker x:Name="SearchDate1" Grid.Column="0" AccentBrush="{StaticResource BrandBrush}" />
for example on image bellow i want to see 09 11 2015
how can i achieve that?
You can set SelectorFormatString="d/m/y" on your DatePicker. See https://www.syncfusion.com/kb/5307/how-can-i-set-different-patterns-for-the-date-in-the-sfdatepicker
I am creating a UK-based website, so users on my site will typically be used to the format dd/mm/yyyy. I have created a datepicker for the users to use, and it works fine, until i pick the 13th day, (13/10/2013). I'm guessing the database is seeing this as a US date, and thus there are not 13 months in a year.
What do i need to do to my code to convert this to the correct format, or change my databse to use UK format? What's easiest?
if(IsPost){
var dateis = Request["date"];
var insert = "INSERT INTO TestTable (testdate) VALUES (#0)";
var qinsert = db.Execute (insert, Request["date"]);
}
}
<div class="container">
<h1>Bootstrap Datepicker</h1>
<form method="post">
<div class="input-append date" id="dp3">
<input class="span2" name="date" size="16" type="text" value="">
<span class="add-on"><i class="icon-th"></i></span>
</div>
<button class="btn btn-success" type="submit" value="Submit"/>Submit</button>
</form>
</div>
<script type="text/javascript">
$('#dp3').datepicker({
format: "dd/mm/yyyy",
autoclose: true,
todayHighlight: true
})
</script>
I personally use the format d MM yyyy for datepickers (eg '14 November 2013'). It takes up more space, but to me it's more readable and completely sidesteps the dd/mm/yyyy vs mm/dd/yyyy issue.
If you want to keep it the way it is, as long as your development machine and server machine is correctly configured for UK times, you can use the AsDateTime() extension method which should resolve the issue.
var qinsert = db.Execute (insert, Request["date"].AsDateTime());
As Mike points out in another answer, this isn't best practise though - having code that is reliant on server setup and the like can easily come back to haunt you.
Generally, you are best advised storing dates in yyyy/mm/dd hh:mm:ss format. That way there is no problem with regional variations. Also, if your app is global, you might want to consider using UTC so that there are no issues with varying server times.
I can not figure out the secret format string to get my time displayed into a time text box. The time is stored in the database in this format '10:30 AM' DeliveryTime is defined as a string in the database. I have tried various versions similar to this below to no avail. Please help.
<input type="time" id="DeliveryTime" name="DeliveryTime" class="form-control" value="#Model.DeliveryTime.ToString("hh:mm tt")">
Looking at the format of the value in the database (10:30 AM) and the format you are trying to use: hh:mm tt, they are the same.. so all you need to do is display it directly:
<input type="time" id="DeliveryTime" name="DeliveryTime" class="form-control" value="#Model.DeliveryTime">
Or am I missing something here?
I am using the below code to show the current date in xslt program.It's working fine With the date format yyyy-mm-dd. But i need the format dd-mmm-yyyy. Please help me to do this.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:cs="urn:cs"
>
<xsl:value-of select="cs:datenow()"></xsl:value-of>
You have tagged your question as XSLT 2.0 so I would expect you to simply get the current date with the current-date function http://www.w3.org/TR/xpath-functions/#func-current-date and to format it with the XSLT 2.0 function format-date http://www.w3.org/TR/xslt20/#format-date.
So basically format-date(current-date(), '[D01]-[MN,*-3]-[Y0001]') gives a format like 11-JUL-2013. Depending on your needs (I am not sure what the format mmm stands for, as most date formatting routines define their own patterns) you need to adapt the "picture string" argument of format-date, see the documentation I linked to.