Many improvements.

This commit is contained in:
Vortrex
2020-12-04 02:48:16 -06:00
parent a7cc0bce7c
commit 33f8c4615a
110 changed files with 3680 additions and 923 deletions

View File

@@ -102,24 +102,35 @@ mexui.Control.Time.prototype.renderAfter = function()
// model
mexui.Control.Time.prototype.generateText = function()
{
this.text = (this.hour < 10 ? '0'+this.hour : this.hour)
this.setText((this.hour < 10 ? '0'+this.hour : this.hour)
+':'+(this.minute < 10 ? '0'+this.minute : this.minute)
+':'+(this.second < 10 ? '0'+this.second : this.second);
+':'+(this.second < 10 ? '0'+this.second : this.second));
};
mexui.Control.Time.prototype.validateInputCallback = function(e, character)
{
var text = this.getTextWithNewCharacter(character);
var parts = text.split(':');
return mexui.util.isPositiveIntChar(character) || character == ':';
};
mexui.Control.Time.prototype.validateValueCallback = function(e)
{
var parts = this.getText().split(':');
if(parts.length != 3)
return false;
for(var i in parts)
{
if(i == 3)
var partAsStr = parts[i];
if(partAsStr === '')
return false;
var part = parseInt(parts[i]);
var part = parseInt(partAsStr);
if(isNaN(part))
if(partAsStr.length == 2 && partAsStr.substr(0, 1) == '0')
partAsStr = partAsStr.substr(1);
if(!mexui.util.isPositiveInt(partAsStr))
return false;
if(part < 0)