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
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ That's it!

```
scheduler: {
enabled: true,
config: {
contentTypes: {
'api::page.page': {}
}
enabled: true,
config: {
contentTypes: {
'api::page.page': {}
}
},
}
},
```

# Set initial dates
Expand All @@ -37,21 +37,21 @@ Set the initial archive date and initial publish date in the plugin settings. Th

```
scheduler: {
enabled: true,
resolve: './src/plugins/strapi-plugin-scheduler',
config: {
'api::page.page': {
initialPublishAtDate: setMonth(
new Date(),
new Date().getMonth() + 1
).toDateString(),
initialArchiveAtDate: setMonth(
new Date(),
new Date().getMonth() + 3
).toDateString(),
},
enabled: true,
resolve: './src/plugins/strapi-plugin-scheduler',
config: {
'api::page.page': {
initialPublishAtDate: setMonth(
new Date(),
new Date().getMonth() + 1
).toDateString(),
initialArchiveAtDate: setMonth(
new Date(),
new Date().getMonth() + 3
).toDateString(),
},
},
},
```

Now when you run your application, the addon will be added to the sidebar. You can choose a date and time to publish or archive your article.
4 changes: 2 additions & 2 deletions admin/src/components/Scheduler/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const Scheduler = () => {
}, [initialData.archiveAt, modifiedData.archiveAt]);

const updateFormValue = (name: string, value: Date | null, initialValue = false) => {
const stringDate = value ? value.toDateString() : null;
const isoDate = value ? value.toISOString() : null;

onChange(
{
target: { name, value: stringDate, type: 'string' }
target: { name, value: isoDate, type: 'string' }
},
initialValue
);
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@webbio/strapi-plugin-scheduler",
"private": false,
"version": "1.0.7",
"version": "1.0.8",
"description": "A plugin to publish or depublish content types in the future.",
"scripts": {
"develop": "tsc -p tsconfig.server.json -w",
Expand All @@ -18,13 +18,15 @@
},
"dependencies": {
"@strapi/design-system": "^1.8.2",
"@strapi/helper-plugin": "^4.12.0",
"@strapi/helper-plugin": "^4.12.5",
"@strapi/icons": "^1.8.2",
"@strapi/typescript-utils": "^4.12.0",
"@strapi/utils": "^4.12.0"
"@strapi/strapi": "4.12.5",
"@strapi/typescript-utils": "^4.12.5",
"@strapi/utils": "^4.12.5"
},
"devDependencies": {
"@strapi/typescript-utils": "^4.12.0",
"@strapi/typescript-utils": "^4.12.5",
"@types/node": "^22.15.18",
"@types/react": "^17.0.53",
"@types/react-dom": "^18.0.28",
"@types/react-router-dom": "^5.3.3",
Expand All @@ -36,7 +38,7 @@
"typescript": "5.1.6"
},
"peerDependencies": {
"@strapi/strapi": "^4.12.0",
"@strapi/strapi": "^4.12.5",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0",
"react-router-dom": "^5.3.4",
Expand All @@ -54,5 +56,6 @@
"node": ">=14.19.1 <=18.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
"license": "MIT",
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
5 changes: 4 additions & 1 deletion tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

"compilerOptions": {
"outDir": "dist",
"rootDir": "."
"rootDir": ".",
"moduleResolution": "node",
"esModuleInterop": true,
"module": "CommonJS"
},

"include": [
Expand Down
Loading