Changing the Time Dropdown fields to 5 min blocks (As opposed to 15 min blocks)

When creating a task or entering a time from the dropdown box, the minutes dropdown list only shows 00, 15, 30 and 45.

I would like to change the minutes field to show 5 minute increments.

ie. 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55.

I have logged in as admin - opened up “DropdownEditor” and modified “duration_intervals” and added the missing 05,10, 20,25,35,40,50,55 fields.
Still not showing up.

I have looked through all the dropdown labels and cannot find another label with the drop minute fields.

Can this be achieved and how would I make this simple change to display the required options in the drop down box when entering a time?

Hi,

Its been a while since I have had to make a change like this but this might help you do it.

it cant be done in studio. the file which it is done is

jssource/src_files/include/SugarFields/Fields/Datetimecombo/Datetimecombo.js

around line 187. you can see it being set to 00,15,30,45

Thx - I editted this file and copied back to the source location, then restartd MySQL and Apache services.
Tried the drop down box and the additional fields are not showing up.

Am I missing something?

Hi all - Attached is a copy of the editted file - I copied it back to the following location listed below…

I have a Win 7 Pro 64Bit pc. Had SugarCRM CE which I then performed the SugarCE to Suite7.1.6 upgrade wizard.
I’ve renamed the file attached to a txt extension. Please rename back to .js if required.

The location which I updated on the pc is :

C:\Program Files (x86)\sugarcrm-6.5.20\apps\sugarcrm\htdocs\jssource\src_files\include\SugarFields\Fields\Datetimecombo

editing Datetimecombo.js (attached as .txt) didnt help for me neither :frowning:

i run
Version 7.2.2
Sugar Version 6.5.20 (Build 1001)

after edit i’v restarted apache and also did a quick repare. - Didnt help
please advise what i did wrong

thanks in advance

HI There,
I know this is an old thread, but has anybody found a solution to this as Im experiencing the exact same issue.
Have tried to move to 5 min increments but it is still showing the default.

Version 7.2.2
Sugar Version 6.5.20 (Build 1001)
PHP Version 5.3.29
Linux Hosting

THanks.

It is just like Ian said. it is located in jssource/src_files/include/SugarFields/Fields/Datetimecombo/Datetimecombo.js

Line 184 it starts with the following :

    text += '\n<option value="00" ' + (this.mins == 0 ? "SELECTED" : "") + '>00</option>';
text += '\n<option value="15" ' + (this.mins == 15 ? "SELECTED" : "") + '>15</option>';
text += '\n<option value="30" ' + (this.mins == 30 ? "SELECTED" : "") + '>30</option>';
text += '\n<option value="45" ' + (this.mins == 45 ? "SELECTED" : "") + '>45</option>';

Now replace it with the following block

text += '\n<option value="00" ' + (this.mins == 0 ? "SELECTED" : "") + '>00</option>';
text += '\n<option value="05" ' + (this.mins == 5 ? "SELECTED" : "") + '>05</option>';
text += '\n<option value="10" ' + (this.mins == 10 ? "SELECTED" : "") + '>10</option>';
text += '\n<option value="15" ' + (this.mins == 15 ? "SELECTED" : "") + '>15</option>';
text += '\n<option value="20" ' + (this.mins == 20 ? "SELECTED" : "") + '>20</option>';
text += '\n<option value="25" ' + (this.mins == 25 ? "SELECTED" : "") + '>25</option>';
text += '\n<option value="30" ' + (this.mins == 30 ? "SELECTED" : "") + '>30</option>';
text += '\n<option value="35" ' + (this.mins == 35 ? "SELECTED" : "") + '>35</option>';
text += '\n<option value="40" ' + (this.mins == 40 ? "SELECTED" : "") + '>40</option>';
text += '\n<option value="45" ' + (this.mins == 45 ? "SELECTED" : "") + '>45</option>';
text += '\n<option value="50" ' + (this.mins == 50 ? "SELECTED" : "") + '>50</option>';
text += '\n<option value="55" ' + (this.mins == 55 ? "SELECTED" : "") + '>55</option>';

save the file… and then the trick… go to admin -> repair and run
- Rebuild JS Compressed Files
- Repair JS Files
wait for the last to say “done”

And you will have a drop down with the time combo of your choice.

1 Like

Thank you - This works perfectly.

please help me how to remove default value . when select data type datetime…

hello… i tried this with new version Versión 7.9.4, but now it seems the file location was changed to… “include/SugarFields/Fields/Datetimecombo/Datetimecombo.js”, however i try with all posible options adding lines but no changes reflect in the combo.

Thank you - This works perfectly for me to.

Hi,

This is something we would like to implement as shown by The-Eyes

My Question is, is the proposed change to this file Datetimecombo.js upgrade proof?

My Concern is this file is part of some core code, so any changes I make will be wiped out by an upgrade.

If this is the case, can this change be done as some sort of customization that is not removed when I do an upgrade

Regards
Brendan

Have you tried the standard procedure, making the changes in this file instead?

custom/jssource/src_files/include/SugarFields/Fields/Datetimecombo/Datetimecombo.js

Create any necessary sub-directories to get there, and put a copy of the original file, with your changes, there.

1 Like

I tried this (using the custom subdir) and it didnt work (did all the repaid/rebuild parts as well). It did work modifying the core code obviously. Has the location changed for jssource custom files at all?

(thats SuiteCRM Version 7.10.7).

I don’t think SuiteCRM is ready to grab custom files for this kind of scenario.

Can you please try editing this line:

https://github.com/salesagility/SuiteCRM/blob/master/include/utils.php#L2545

Change it to

    return '<script type="text/javascript" src="' . getVersionedPath(get_custom_file_if_exists($path), $additional_attrs) . '"></script>';

If this works well, we can put it into the main code for everyone.

Hmm,

That didnt work, after having another look I am not surprised, that part of the code outputs a command. These JS files appear to be cached into a single file (somewhere), there is no Datetimecombo.js file being loaded in my network/source code. However there is a sugar_field_grp.js file that contains the contents of the Datetimecombo.js file.

It seems thats the wrong location to change at any rate. I suspect the place that needs changing is here:

https://github.com/salesagility/SuiteCRM/blob/master/jssource/minify_utils.php#L88

Regards

Mark

Ok, you are right, it seems. I didn’t (and don’t have much time to look at this).

If you do get it working please post the complete solution. Thanks!

Just a quick query with regards this, i was looking to modify core code and submit the change to allow this to be configurable (defaulting to 15 minutes obviously). Is there a way from with javascript to access the Sugar Config Vars stored in the config/config_override php files?

That way I can check this and change those hard coded lines to a loop thats set via a “gap” variable stored in the config file.

Regards

Mark