hello i am using the code bellow to show a datetimepicker in a custom file, the field show properly but i cant remove the time on the field, because i just need date, i think there is a script on the code that must be place in other place, but i could find in custom file otionpis there any way to reach this, or show a picker in other way?thanks
the script code is:
$(function () {
$(‘#datetimepicker4’).datetimepicker({
format: ‘L’
});
});
hello is this way correct?
loadjs.ready(“load”, function() {
$(‘#datetimepicker4’).datetimepicker({
format: ‘L’
});
});</scri pt>thanks for help
Try this (make sure you have replaced “your_form_id” with your actual form id, and assume the “datetimepicker4” is the id of the related textbox control):
loadjs.ready([“your_form_id”, “datetimepicker”], function() {
ew.createDateTimePicker(“your_form_id”, “datetimepicker4”, {“ignoreReadonly”:true,“useCurrent”:false,“format”:1});
});
</scr ipt>
Hello mohar i test your code but dosent work, what i need is to remove the time from the textbox control and just show date. now i dont have a form just a textbox for testing in a custom filei put on my in head your code on this way:
loadjs.ready([“datetimepicker4”, “datetimepicker”], function() {
ew.createDateTimePicker(“datetimepicker4”, “datetimepicker4”, {“ignoreReadonly”:true,“useCurrent”:false,“format”:1});
});
</scri pt>and in my custom file this code:
<di v class="in put-group date" id="datetimepicker4" data-target-input="nearest">
<inp ut type="text" class="form-control datetimepicker-input" data-target="#datetimepicker4"/>
<di v class="inp ut-group-append" data-target="#datetimepicker4" data-toggle="datetimepicker">
<di v class="inp ut-group-text"><i class="fa fa-calendar"></i></div>
but the time still appear on textbox when i select dateany idea?
Try to play with the “format” option in this code:
ew.createDateTimePicker(“datetimepicker4”, “datetimepicker4”, {“ignoreReadonly”:true,“useCurrent”:false,“format”:1});For example, change it to 2 (Short Date - without time) instead of 1 (Long Date - with time). You may read for further more from the generated phpfn.php file; see the comment/explanation above the FormatDateTime() global function.Just put that code below the code that displaying Textbox control. You may actually refer to the generated code in a Add/Edit page that implements datetimepicker.
hello, i did but dosent work, but also i copied the exact code from a generate page where i use a datetimepicker, and in a custom filethe code show TIME and on the original page not, so i think in a custom file always will show the time
Where is the code to display the datetimepicker control?
=“ct_ratesupdates_add”>Rate Start On&nb p;
</but ton></ iv>
I did not see ew.createDateTimePicker in your code.
i yhis way code is show in generate file, any way i will forget thisthanks