@malloydata/malloy 0.0.197-dev241009205116 → 0.0.197-dev241010003320
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.
|
@@ -308,5 +308,13 @@ describe('source:', () => {
|
|
|
308
308
|
`).toTranslate();
|
|
309
309
|
});
|
|
310
310
|
});
|
|
311
|
+
test('dates do not become timestamps', () => {
|
|
312
|
+
const dateThing = (0, test_translator_1.model) `source: hasDate is a -> { select: ad }`;
|
|
313
|
+
expect(dateThing).toTranslate();
|
|
314
|
+
const hasDate = dateThing.translator.getSourceDef('hasDate');
|
|
315
|
+
expect(hasDate).toBeDefined();
|
|
316
|
+
const ad = (0, test_translator_1.getFieldDef)(hasDate, 'ad');
|
|
317
|
+
expect(ad).toMatchObject({ name: 'ad', type: 'date' });
|
|
318
|
+
});
|
|
311
319
|
});
|
|
312
320
|
//# sourceMappingURL=source.spec.js.map
|
|
@@ -1925,25 +1925,17 @@ class QueryQuery extends QueryField {
|
|
|
1925
1925
|
case 'date':
|
|
1926
1926
|
case 'timestamp': {
|
|
1927
1927
|
const timeframe = fi.f.fieldDef.timeframe;
|
|
1928
|
+
const fd = { type: fi.f.fieldDef.type };
|
|
1928
1929
|
if (timeframe) {
|
|
1929
|
-
|
|
1930
|
-
name,
|
|
1931
|
-
type: 'timestamp',
|
|
1932
|
-
timeframe,
|
|
1933
|
-
resultMetadata,
|
|
1934
|
-
location,
|
|
1935
|
-
annotation,
|
|
1936
|
-
});
|
|
1937
|
-
}
|
|
1938
|
-
else {
|
|
1939
|
-
fields.push({
|
|
1940
|
-
name,
|
|
1941
|
-
type: 'timestamp',
|
|
1942
|
-
resultMetadata,
|
|
1943
|
-
location,
|
|
1944
|
-
annotation,
|
|
1945
|
-
});
|
|
1930
|
+
fd.timeframe = timeframe;
|
|
1946
1931
|
}
|
|
1932
|
+
fields.push({
|
|
1933
|
+
name,
|
|
1934
|
+
...fd,
|
|
1935
|
+
resultMetadata,
|
|
1936
|
+
location,
|
|
1937
|
+
annotation,
|
|
1938
|
+
});
|
|
1947
1939
|
break;
|
|
1948
1940
|
}
|
|
1949
1941
|
case 'number':
|