Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/notion-utils/src/get-all-pages-in-space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export async function getAllPagesInSpace(
page.collection_query
)) {
for (const collectionData of Object.values(collectionViews)) {
const { blockIds } = collectionData

const { blockIds } =
collectionData?.collection_group_results || {}
if (blockIds) {
for (const collectionItemId of blockIds) {
void processPage(collectionItemId, depth + 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function getCollectionGroups(
}

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

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-notion-x/src/third-party/eval-formula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function evalFunctionFormula(

case 'object':
if (value instanceof Date) {
return format(value as Date, 'MMM d, YYY')
return format(value as Date, 'MMM d, yyyy')
} else {
// shouldn't ever get here
return `${value}`
Expand Down
6 changes: 3 additions & 3 deletions packages/react-notion-x/src/third-party/property.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function PropertyImpl(props: IPropertyProps) {
}

if (content instanceof Date) {
content = format(content, 'MMM d, YYY hh:mm aa')
content = format(content, 'MMM d, yyyy hh:mm aa')
}
} catch {
// console.log('error evaluating formula', schema.formula, err)
Expand Down Expand Up @@ -437,15 +437,15 @@ export function PropertyImpl(props: IPropertyProps) {
const renderCreatedTimeValue = React.useMemo(
() =>
function CreatedTimeProperty() {
return format(new Date(block!.created_time), 'MMM d, YYY hh:mm aa')
return format(new Date(block!.created_time), 'MMM d, yyyy hh:mm aa')
},
[block]
)

const renderLastEditedTimeValue = React.useMemo(
() =>
function LastEditedTimeProperty() {
return format(new Date(block!.last_edited_time), 'MMM d, YYY hh:mm aa')
return format(new Date(block!.last_edited_time), 'MMM d, yyyy hh:mm aa')
},
[block]
)
Expand Down