aotrautils-srv 0.0.731 → 0.0.733

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (07/11/2023-02:22:27)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (07/11/2023-23:27:53)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -2179,12 +2179,17 @@ window.compareDates=function(date1=null,date2=null){
2179
2179
  if(date1==null && date2==null) return 0;
2180
2180
  if(date1==null && date2!=null) return 1;
2181
2181
  if(date1!=null && date2==null) return -1;
2182
- if(typeof(date1)!="Date" || typeof(date2)!="Date"){
2183
- throw new Error(`Cannot compare dates with types : ${typeof(date1)} ; ${typeof(date2)}`);
2182
+ if(typeof(date1)=="Date" && typeof(date2)=="Date"){
2183
+ if(date1.getTime()==date2.getTime()) return 0;
2184
+ if(date1.getTime()<date2.getTime()) return 1;
2185
+ return -1;
2184
2186
  }
2185
- if(date1.getTime()==date2.getTime()) return 0;
2186
- if(date1.getTime()<date2.getTime()) return 1;
2187
- return -1;
2187
+ if(typeof(date1)=="number" && typeof(date2)=="number"){
2188
+ if(date1==date2) return 0;
2189
+ if(date1<date2) return 1;
2190
+ return -1;
2191
+ }
2192
+ throw new Error(`Cannot compare dates with types : ${typeof(date1)} ; ${typeof(date2)}`);
2188
2193
  }
2189
2194
 
2190
2195
 
@@ -5156,7 +5161,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5156
5161
 
5157
5162
 
5158
5163
 
5159
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (07/11/2023-02:22:27)»*/
5164
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (07/11/2023-23:27:53)»*/
5160
5165
  /*-----------------------------------------------------------------------------*/
5161
5166
 
5162
5167
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.731",
3
+ "version": "0.0.733",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",