rez_core 6.1.6 → 6.1.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "6.1.6",
3
+ "version": "6.1.7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -119,9 +119,17 @@ export class ResolverService {
119
119
  attr.element_type === 'date' ||
120
120
  (attr.element_type === 'datetime' && !format_disable)
121
121
  ) {
122
- const dateFormat =
123
- attr.element_type === 'date' ? 'DD-MM-YYYY' : 'DD-MM-YYYY HH:mm:ss';
124
- const dateValue = moment(codeValue, dateFormat).utcOffset('+05:30'); // IST
122
+ // Allow both DD-MM-YYYY and standard ISO YYYY-MM-DD
123
+ const allowedFormats =
124
+ attr.element_type === 'date'
125
+ ? ['DD-MM-YYYY', 'YYYY-MM-DD']
126
+ : ['DD-MM-YYYY HH:mm:ss', 'YYYY-MM-DD HH:mm:ss', moment.ISO_8601];
127
+
128
+ // strict parsing enabled
129
+ const dateValue = moment(codeValue, allowedFormats, true).utcOffset(
130
+ '+05:30',
131
+ );
132
+
125
133
  if (dateValue.isValid()) {
126
134
  resolvedEntityData[field] =
127
135
  attr.element_type === 'date'