Open tormozit opened 8 months ago
The editor uses some heuristics to determine whether a value contains a unix timestamp, and in that case displays a tag showing the date. Similarly, it interprets when a values is a color and then shows a colorpicker.
If you don't want the date tag, you can hide it via CSS.
Do you actually have with real world data with numbers in this range?
I think many users will be happy to have an option to turn off the heuristics. I agree they are usefull but not all the time. My case - user was confused by strange data in tree mode. And he created bug-ticket for me.
Makes sense to implement a configuration option for this. And we should probably create an option for the color picker too.
Anyone interested in implementing this option? Help would be welcome.
For my taste gray color is optimal for most cases. Current blue is too saturated.
editor.menu.style.backgroundColor = "#d0d0d0";
I turned off unwanted date heuristics here
if (this._showTimestampTag()) {
if (!this.dom.date) {
return // FIX
this.dom.date = document.createElement('div');
this.dom.date.className = 'jsoneditor-date';
this.dom.value.parentNode.appendChild(this.dom.date);
}
ОК { "test": 123456789012 }
Not OK - extra date appeared { "test": 1234567890123 }