Skip to content

Commit 25f44b6

Browse files
Merge pull request #660 from Euruson/fix-collection-traverse
2 parents d4053b2 + d39c7d6 commit 25f44b6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

packages/notion-utils/src/get-all-pages-in-space.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ export async function getAllPagesInSpace(
108108
page.collection_query
109109
)) {
110110
for (const collectionData of Object.values(collectionViews)) {
111-
const { blockIds } = collectionData
112-
111+
const { blockIds } =
112+
collectionData?.collection_group_results || {}
113113
if (blockIds) {
114114
for (const collectionItemId of blockIds) {
115115
void processPage(collectionItemId, depth + 1)

packages/react-notion-x/src/third-party/collection-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function getCollectionGroups(
3434
}
3535

3636
// TODO: review dates format based on value.type ('week'|'month'|'year')
37-
queryValue = format(new Date(queryLabel), 'MMM d, YYY hh:mm aa')
37+
queryValue = format(new Date(queryLabel), 'MMM d, yyyy hh:mm aa')
3838
}
3939

4040
return {

packages/react-notion-x/src/third-party/eval-formula.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ function evalFunctionFormula(
300300

301301
case 'object':
302302
if (value instanceof Date) {
303-
return format(value as Date, 'MMM d, YYY')
303+
return format(value as Date, 'MMM d, yyyy')
304304
} else {
305305
// shouldn't ever get here
306306
return `${value}`

packages/react-notion-x/src/third-party/property.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function PropertyImpl(props: IPropertyProps) {
9292
}
9393

9494
if (content instanceof Date) {
95-
content = format(content, 'MMM d, YYY hh:mm aa')
95+
content = format(content, 'MMM d, yyyy hh:mm aa')
9696
}
9797
} catch {
9898
// console.log('error evaluating formula', schema.formula, err)
@@ -437,15 +437,15 @@ export function PropertyImpl(props: IPropertyProps) {
437437
const renderCreatedTimeValue = React.useMemo(
438438
() =>
439439
function CreatedTimeProperty() {
440-
return format(new Date(block!.created_time), 'MMM d, YYY hh:mm aa')
440+
return format(new Date(block!.created_time), 'MMM d, yyyy hh:mm aa')
441441
},
442442
[block]
443443
)
444444

445445
const renderLastEditedTimeValue = React.useMemo(
446446
() =>
447447
function LastEditedTimeProperty() {
448-
return format(new Date(block!.last_edited_time), 'MMM d, YYY hh:mm aa')
448+
return format(new Date(block!.last_edited_time), 'MMM d, yyyy hh:mm aa')
449449
},
450450
[block]
451451
)

0 commit comments

Comments
 (0)