[FIX] point_of_sale: date string ECMA 5.1 in Date()
Before this commit, when opening the POS in IE11, then the customer list, the list was empty. This was due to condition that was wrongly evaluated as false due to the fact that IE11 apparently only wants ECMA5.1 to deal with constructing Date() from a string. After this commit, we construct the Date() object with the right string, and the list of customers doesn't disappear. OPW 776463 For reference: http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15 closes #20468
This commit is contained in:
@@ -255,10 +255,12 @@ var PosDB = core.Class.extend({
|
||||
for(var i = 0, len = partners.length; i < len; i++){
|
||||
partner = partners[i];
|
||||
|
||||
if ( this.partner_write_date &&
|
||||
var local_partner_date = (this.partner_write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z');
|
||||
var dist_partner_date = (partner.write_date || '').replace(/^(\d{4}-\d{2}-\d{2}) ((\d{2}:?){3})$/, '$1T$2Z');
|
||||
if ( this.partner_write_date &&
|
||||
this.partner_by_id[partner.id] &&
|
||||
new Date(this.partner_write_date).getTime() + 1000 >=
|
||||
new Date(partner.write_date).getTime() ) {
|
||||
new Date(local_partner_date).getTime() + 1000 >=
|
||||
new Date(dist_partner_date).getTime() ) {
|
||||
// FIXME: The write_date is stored with milisec precision in the database
|
||||
// but the dates we get back are only precise to the second. This means when
|
||||
// you read partners modified strictly after time X, you get back partners that were
|
||||
|
||||
Reference in New Issue
Block a user