Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ how to remove time from an html field

Posted by: bobk Jul 12 2018, 11:14 AM

Hello, is there an HTML formatting option that will remove the time field from a datetime value on an HTML row?

For example, i dummied out the "datepicker" below because i just want to show the date without the time, but not show a text box and date selector, just a label and the date and so i tried using the "date-format" utility from the "datepicker" hoping it would allow me to just show the date on a regular HTML display field like below, but the "date-format" utility didn't seem to work

CODE

                <td width="9%" class="lbl-text">Selection Date:</td>
                <td width="16%">
                    <input class="k-textbox" type="text" disabled="disabled" style="border:none" data-bind="value: bipVm.selectionDate" data-format="{0:MM/dd/yyyy}"/>
                </td>

                <!-- <td width="16%">
                    <input data-role="datepicker"
                           class="k-datepicker"
                           style="border:none"
                           data-format="{0:MM/dd/yyyy}"
                           data-bind="enabled: isEmpEnabled, value: bipVm.selectionDate" />
                </td> -->


what is showing on the screen:
Selection Date: 2018-06-06T00:00:00.000

Posted by: CharlesEF Jul 12 2018, 03:07 PM

What format do you get the dates in? I mean, is the date you get a date object or a date string?

Posted by: Christian J Jul 12 2018, 05:23 PM

QUOTE(bobk @ Jul 12 2018, 06:14 PM) *

Hello, is there an HTML formatting option that will remove the time field from a datetime value on an HTML row?

Not sure I understand the question. The code example just seems to show a couple of ordinary text fields, with some attribute values that look like Tumblr(?) code. Maybe Tumblr(?) is doing something more with this table row, but it's impossible to say what.

Posted by: pandy Jul 12 2018, 05:35 PM

Looks like this part formats the date stamp.

CODE
data-format="{0:MM/dd/yyyy}"


MM/dd/yyyy probably gives you (for example) July/12/2018 or 07/12/2018. But the bit before that, (0) looks odd. How did it look before you fiddled with it?

BTW, this isn't HTML. I don't know what it is, but HTML it ain't.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)