Hi,
Is there a way to modify this function in an upgrade safe way ?
Thanks
datetime field
Collapse
X
-
)) https://forum.espocrm.com/forum/general/25255-event
as you can see, you have the "default" option. Copy this row here
"default": "javascript: return this.dateTime.getNowMoment().hours(8).minutes(0).u tc().format(this.dateTime.internalDateTimeFormat); ",
The method I wrote before (client/src/views/fields/datetime.js setDefaultTime) is for all datetime field, which doesn't have the default value. This method (with default) affects only for this field. -
I have looked again at the fields of the entity meetinmg. (see attachment) This is probably the reason why it works with this entity.
Unfortunately I can't insert this script into the other file types. There's a selection menu.1 PhotoLeave a comment:
-
it works for Meetings. with your own entity it doesn't work
"anfang": {
"notNull": false,
"type": "datetime",
"required": false,
"isCustom": true,
"default": null,
"audited": false,
"readOnly": false,
"tooltip": false
},Leave a comment:
-
For me it works. Could you share more information about the field?
- the entity (if not custom)
- field Defs (/Resorses/enitityDefs/{EntityName}.json -> fields -> {field} content)Leave a comment:
-
After clear local cache, refreshing page and for new record without the default value?Leave a comment:
-
I tested with
setDefaultTime: function () {
var d = moment('2014-01-01 11:00').format(this.getDateTime().getDateTimeForma t()) || '';
var index = d.indexOf(' ');
if (~index) {
this.$time.val(d.substr(index + 1));
}
},Leave a comment:
-
Can you give me an example? :
setDefaultTime: function () {
var d = moment('2014-01-01 00:00').format(this.getDateTime().getDateTimeForma t()) || '';
var index = d.indexOf(' ');
if (~index) {
this.$time.val(d.substr(index + 1));
}
},Leave a comment:
-
Hi Peter,
the easiest way is to set default in Entity Manager. It will set curent time as default an autoscroll to current time value.
If you want to set in the file client/src/views/fields/datetime.js setDefaultTime - change the time value. (from 00:00 to 11:00 for example). You can change the view for all datetime field or only for needed.Leave a comment:
-
Hi Tanya,
Thanks for your suggestions.
We have created our own modules in which we record times. I have already used the idea of calculating the end time using duration.
The determination of the duration in the person works it ouit in his head miscalculations.
The problem of scrolling from 00:00 to a time is complex in each module.
peterLeave a comment:
-
Hi,
you can override tho view for your field "beginning", or you can add a field "duration" and "end" field will be calculated on the form, like in Meeting and Call entity?
What is the name of your entity, and what way is good for you?Leave a comment:

Leave a comment: