Is there a way to change the Format of Date Time Picker in Portal to 24 hour instead of 12 hours Am/Pm:
Regards,
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
Is there a way to change the Format of Date Time Picker in Portal to 24 hour instead of 12 hours Am/Pm:
Regards,
you can try following way:
Create a custom JavaScript file in your Odoo module or theme. Let's name it custom_script.js.
In the custom_script.js file, add the following code to modify the default format of the Date Time Picker:
odoo.define('your_module_name.custom_script', function (require) {
    "use strict";
    var core = require('web.core');
    var FieldDateTime = core.form_widget_registry.get('datetime');
    FieldDateTime.include({
        pickerDateTimeFormat: 'YYYY-MM-DD HH:mm:ss',
    });
});
Replace 'your_module_name' with the actual name of your Odoo module.
Thank you for your reply, Should i add the asset file in the manifest ?
yes,add js file reference according to odoo version
i have already added and edited everything a you mentioned. But nothing changed regarding the datetime picker.
Manifest:
....
    'assets': {
        'web.assets_frontend': [
            'attendance_regularization/static/src/js/custom_script.js',            
        ]
    },
custom_script.js :
odoo.define('attendance_regularization.custom_script', function (require) {
	"use strict";
var core = require('web.core');
	var FieldDateTime = core.form_widget_registry.get('datetime');
FieldDateTime.include({
	pickerDateTimeFormat: 'YYYY-MM-DD HH:mm',
	});
});
Portal view:
<div class="row">
    <div class="form-group col-xl-3">
        <label class="col-form-label" for="from_date"><b>From Date:</b></label>
    </div>
    <div class="form-group col-xl-6">
        <input type="datetime-local" name="from_date" class="form-control" required="true" />
    </div>
</div>
am i missing something here ?
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|  | 0 Okt 23  | 1639 | ||
|  | 0 Apr 22  | 5463 | ||
|  | 3 Des 24  | 3613 | ||
| 
            
                How to remove "contact us" from the header 
            
            
                    Diselesaikan
            
         |  | 4 Mar 24  | 6104 | |
|  | 1 Mar 24  | 2250 |