restored milliseconds support in sails-mysql

parent 1d4910a9
...@@ -5,7 +5,7 @@ var ASSETS_PATH = path.join(__dirname, '..', 'assets'); ...@@ -5,7 +5,7 @@ var ASSETS_PATH = path.join(__dirname, '..', 'assets');
var UPLOAD_PATH = path.join(__dirname, '..', '..', 'upload'); var UPLOAD_PATH = path.join(__dirname, '..', '..', 'upload');
module.exports.pictogram = { module.exports.pictogram = {
version: "1.0", // actual version of the server, to be checked by the client version: "1.1", // actual version of the server, to be checked by the client
admin: { admin: {
email: 'amontejo@ujaen.es', email: 'amontejo@ujaen.es',
password: '$2a$06$flEEOc15SerMeYWARrN9w.KSpJuM.jDsaTgrtD0ESzbxKHPl0f/zq' //y00ttaa!! password: '$2a$06$flEEOc15SerMeYWARrN9w.KSpJuM.jDsaTgrtD0ESzbxKHPl0f/zq' //y00ttaa!!
......
...@@ -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(-3);
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