fixed client observations to apply eslint rules plus bug fixed in datePicker

This commit is contained in:
Carlos Jimenez 2018-01-09 13:53:21 +01:00
parent 329b025c74
commit c3d6a9c043
2 changed files with 4 additions and 4 deletions

View File

@ -155,8 +155,8 @@ class DatePicker extends Component {
if (!this.iniOptions.locale) if (!this.iniOptions.locale)
this.iniOptions.locale = this.$translate.use(); this.iniOptions.locale = this.$translate.use();
if (!this.iniOptions.dateFormat && this.iniOptions.locale === 'es') if (!this.iniOptions.dateFormat)
this.iniOptions.dateFormat = 'd-m-Y'; this.iniOptions.dateFormat = this.iniOptions.locale === 'es' ? 'd-m-Y' : 'm-d-Y';
else if (this.iniOptions.dateFormat) { else if (this.iniOptions.dateFormat) {
let format = this.iniOptions.dateFormat.split(/[ZT.,/ :-]/); let format = this.iniOptions.dateFormat.split(/[ZT.,/ :-]/);
if (format.length <= 1) { if (format.length <= 1) {

View File

@ -8,9 +8,9 @@ module.exports = function(Self) {
ctx.instance.created = Date(); ctx.instance.created = Date();
let token = ctx.options.accessToken; let token = ctx.options.accessToken;
let userId = token && token.userId; let userId = token && token.userId;
let app = require('../../server/server'); let app = require('../../server/server');
let Employee = app.models.Employee; let Employee = app.models.Employee;
Employee.findOne({where: {userFk: userId}}, function (err, user){ Employee.findOne({where: {userFk: userId}}, (err, user) => {
if (user) { if (user) {
ctx.instance.employeeFk = user.id; ctx.instance.employeeFk = user.id;
next(); next();