details:   https://code.tryton.org/tryton/commit/1c0b002d3167
branch:    8.2
user:      Cédric Krier <[email protected]>
date:      Fri Oct 30 10:18:56 2026 +0100
description:
        Always use moment in UTC for date

        Closes #15204
        (grafted from accaf443e6d00b6349147fb5f3d3388af6ed1073)
diffstat:

 sao/src/pyson.js |  1 -
 sao/src/sao.js   |  3 +++
 2 files changed, 3 insertions(+), 1 deletions(-)

diffs (34 lines):

diff -r 9fa1ec5baa2d -r 1c0b002d3167 sao/src/pyson.js
--- a/sao/src/pyson.js  Thu Oct 29 18:16:51 2026 +0100
+++ b/sao/src/pyson.js  Fri Oct 30 10:18:56 2026 +0100
@@ -794,7 +794,6 @@
         }
         if (!date || !date.isDate) {
             date = Sao.Date();
-            date.utc(true);
         }
         if (value.y) date.year(value.y);
         if (value.M) date.month(value.M - 1);
diff -r 9fa1ec5baa2d -r 1c0b002d3167 sao/src/sao.js
--- a/sao/src/sao.js    Thu Oct 29 18:16:51 2026 +0100
+++ b/sao/src/sao.js    Fri Oct 30 10:18:56 2026 +0100
@@ -253,6 +253,7 @@
         date.date(day);
         date.set({hour: 0, minute: 0, second: 0, millisecond: 0});
         date.isDate = true;
+        date.utc(true);
         return date;
     };
 
@@ -260,9 +261,11 @@
     Sao.Date.min = moment(new Date((-100000000 + 1) * 86400000));
     Sao.Date.min.set({hour: 0, minute: 0, second: 0, millisecond: 0});
     Sao.Date.min.isDate = true;
+    Sao.Date.min.utc(true);
     Sao.Date.max = moment(new Date(100000000 * 86400000));
     Sao.Date.max.set({hour: 0, minute: 0, second: 0, millisecond: 0});
     Sao.Date.max.isDate = true;
+    Sao.Date.max.utc(true);
 
     Sao.DateTime = function(
         year, month, day,

Reply via email to