restored sails-mysql files for milliseconds support

parent c751ca44
...@@ -468,7 +468,7 @@ function sqlTypeCast(attr) { ...@@ -468,7 +468,7 @@ function sqlTypeCast(attr) {
break; break;
case 'datetime': case 'datetime':
expandedType = 'DATETIME'; expandedType = 'DATETIME(3)';
break; break;
case 'time': case 'time':
...@@ -499,7 +499,8 @@ function toSqlDate(date) { ...@@ -499,7 +499,8 @@ function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' + ('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' + ('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' + ('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2); ('00' + date.getSeconds()).slice(-2) + '.' +
('00' + date.getMilliseconds()).slice(-3);
return date; return date;
} }
......
...@@ -242,7 +242,8 @@ utils.toSqlDate = function toSqlDate(date) { ...@@ -242,7 +242,8 @@ utils.toSqlDate = function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' + ('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' + ('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' + ('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2); ('00' + date.getSeconds()).slice(-2) + '.' +
('00' + date.getMilliseconds()).slice(-2);
return date; return date;
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment