Skip to content

Commit

Permalink
Bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Giulieri committed May 7, 2014
1 parent 7fc484f commit da553ea
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dist/css/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
border-bottom: #366092 solid 1px;
width: 100%;
padding: 2px 5px 2px 10px;
z-index: 3000;
z-index: 300;
}
.evo-header a {
color: #c6d9f0;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/evolutility.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
border-bottom: #366092 solid 1px;
width: 100%;
padding: 2px 5px 2px 10px;
z-index: 3000;
z-index: 300;
}
.evo-header a {
color: #c6d9f0;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/evolutility.min.css

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions dist/evolutility.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,18 @@ Evol.UI = {

// --- date formats ---
formatDate: function(d){
var dateParts=d.split('-');
if(dateParts.length>1){
return dateParts[1]+'/'+dateParts[2]+'/'+dateParts[0];
if(!_.isUndefined(d) && d!==null){
var dateParts=d.split('-');
if(dateParts.length>1){
return dateParts[1]+'/'+dateParts[2]+'/'+dateParts[0];
}
}
return '';
},
formatTime: function(d){
if(!_.isUndefined(d) && d!==''){
var timeParts=d.split(':');
var hour=parseInt(timeParts[0],10);
if(!_.isUndefined(d) && d!==null && d!==''){
var timeParts=d.split(':'),
hour=parseInt(timeParts[0],10);
if(hour>12){
return (hour-12)+':'+timeParts[1]+' PM';
}else{
Expand All @@ -291,7 +294,7 @@ Evol.UI = {
return '';
},
formatDateTime: function(d){
if(!_.isUndefined(d) && d!==''){
if(!_.isUndefined(d) && d!==null && d!==''){
var dateParts=d.split('T');
if(dateParts.length>1){
return this.formatDate(dateParts[0])+', '+this.formatTime(dateParts[1]);
Expand Down Expand Up @@ -523,9 +526,9 @@ Evol.UI.Validation = {
break;
case ft.dec:
case ft.money:
var myRegExp = evoRegEx[fd.type + Evol.i18n.LOCALE];
var myRegExp = evoRegEx[ft.dec + Evol.i18n.LOCALE];
if (myRegExp === null) {
myRegExp = evoRegEx[fd.type + "EN"]; // default to English with "."
myRegExp = evoRegEx[ft.dec + 'EN']; // default to English with "."
}
if (!myRegExp.test(fv))
that.setValidationFlags($f.parent(), labMsg(i18nVal[fd.type]));
Expand Down
6 changes: 3 additions & 3 deletions dist/evolutility.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/ui-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ Evol.UI.Validation = {
break;
case ft.dec:
case ft.money:
var myRegExp = evoRegEx[fd.type + Evol.i18n.LOCALE];
var myRegExp = evoRegEx[ft.dec + Evol.i18n.LOCALE];
if (myRegExp === null) {
myRegExp = evoRegEx[fd.type + "EN"]; // default to English with "."
myRegExp = evoRegEx[ft.dec + 'EN']; // default to English with "."
}
if (!myRegExp.test(fv))
that.setValidationFlags($f.parent(), labMsg(i18nVal[fd.type]));
Expand Down
17 changes: 10 additions & 7 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,18 @@ Evol.UI = {

// --- date formats ---
formatDate: function(d){
var dateParts=d.split('-');
if(dateParts.length>1){
return dateParts[1]+'/'+dateParts[2]+'/'+dateParts[0];
if(!_.isUndefined(d) && d!==null){
var dateParts=d.split('-');
if(dateParts.length>1){
return dateParts[1]+'/'+dateParts[2]+'/'+dateParts[0];
}
}
return '';
},
formatTime: function(d){
if(!_.isUndefined(d) && d!==''){
var timeParts=d.split(':');
var hour=parseInt(timeParts[0],10);
if(!_.isUndefined(d) && d!==null && d!==''){
var timeParts=d.split(':'),
hour=parseInt(timeParts[0],10);
if(hour>12){
return (hour-12)+':'+timeParts[1]+' PM';
}else{
Expand All @@ -288,7 +291,7 @@ Evol.UI = {
return '';
},
formatDateTime: function(d){
if(!_.isUndefined(d) && d!==''){
if(!_.isUndefined(d) && d!==null && d!==''){
var dateParts=d.split('T');
if(dateParts.length>1){
return this.formatDate(dateParts[0])+', '+this.formatTime(dateParts[1]);
Expand Down
4 changes: 3 additions & 1 deletion less/header.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// https://github.com/evoluteur/evolutility
// Copyright (c) 2014, Olivier Giulieri

// todo: WILL BE REMOVED LATER FOR BOOTSTRAP

/* --- header, navbar, content and footer --- */

@import "less/variables";
Expand Down Expand Up @@ -49,7 +51,7 @@
border-bottom: #366092 solid 1px;
width:100%;
padding:2px 5px 2px 10px;
z-index: 3000;
z-index: 300;
//-webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
//-moz-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
//box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
Expand Down

0 comments on commit da553ea

Please sign in to comment.