08-04-2020 04:31 PM
Hi
it would be great if this page had an example on how to format the date time string on a NXG WebVI timestamp control, as not everyone wants American date time format with milliseconds.
https://ni.github.io/webvi-examples/CustomizeWithCss/
gviweb is a special kind of VI. It is actually a embedded web browser. A lot control properties are different between gvi and .gviweb ( With the normal gvi, the Timestamp Control can be changed to desired format of date and time. But for gviweb, it is not possible to do that.)
From:
and..
To set a property(option), you need to pass the property name and value(s) in the jqxDateTimeInput's constructor.
$("#jqxdatetimeinput").jqxDateTimeInput({ formatString: "dd/MM/yyyy" });
I got this to work with my basic CSS / javascript knowledge:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$(".timestamp").attr("format-string", "dd/MM/yyyy HH:mm");
});
</script>
My code waits for the page to load, then updates the format-string attribute with my preferred format string. I do feel there should be a cleaner way.
Nick
10-01-2020 05:01 PM
I only need date picker option now. But I can't figure out how to hide the time selection in the footer?