strapi-calendar icon indicating copy to clipboard operation
strapi-calendar copied to clipboard

Custom Default Event Duration - Request.

Open Jacob-Daniel opened this issue 1 year ago • 3 comments

Hi,

Thanks for your work on this.

I am wanting to use this plugin for a campsite booking application, I would like to set the Default Duration to allDay. I have run into trouble trying to set this up:

Summary of Issues

Environment: Strapi Version: 4.25.x Plugin Name: @offset-dev/strapi-calendar Steps Taken: Installation of the Plugin:

Installed @offset-dev/strapi-calendar using a package manager (pnpm).

At this point, the install is all good and the plugin is available in admin.

Initial Plugin Configuration: Configured the plugin in config/plugins.js:

module.exports = ({ env }) => ({
  "strapi-calendar": {
    enabled: true,
  },
});

Encountered the following error:

Error: Error loading the plugin strapi-calendar because strapi-calendar is not installed. Adjusting Plugin Name, modified the configuration to:

module.exports = ({ env }) => ({
  "@offset-dev/strapi-calendar": {
    enabled: true,
  },
});

Received the error:

Error: Plugin name "@offset-dev/strapi-calendar" is not in kebab (an-example-of-kebab-case).
Using Kebab-Case:

Attempted to set the plugin in kebab-case with:

module.exports = ({ env }) => ({
  'strapi-calendar': {
    enabled: true,
    defaultDuration: 1440, // Set full day to 24 hours
  },
});

Encountered the same error regarding installation:

Error: Error loading the plugin strapi-calendar because strapi-calendar is not installed.
Custom Resolve Path:

Attempted to resolve the plugin using a custom path:

module.exports = ({ env }) => ({
  'strapi-calendar': {
    enabled: true,
    resolve: './src/plugins/@offset-dev/strapi-calendar',
  },
});

Received the same installation error. Error Details:

Error: Plugin not installed despite verification that the plugin was included in the project.
Error: Plugin name not in the expected kebab-case format.
Error: Issues with loading the plugin configuration leading to a failure in starting Strapi.

Current Status: The Strapi application fails to start due to plugin configuration issues, specifically with naming conventions and installation recognition.

Thank you,

Jacob

Jacob-Daniel avatar Sep 30 '24 14:09 Jacob-Daniel

Hey Jacob, Sounds like you are wanting to override the code in this plugin, for that you might need a different approach. I would recommend cloning the repo and using yalc to link your strapi app and your calendar plugin. More info on that here

LuisRodriguezLD avatar Sep 30 '24 15:09 LuisRodriguezLD

Hi Luis,

Thanks for the quick reply, that is helpful.

Would it be helpful to extend the plugin/ create a fork to add

view.settings.section.general.default-duration.fullDay

I have not worked on a open-source project before, would be happy to have a look into it.

Jacob

Jacob-Daniel avatar Sep 30 '24 16:09 Jacob-Daniel

Yes, that sounds like a great idea! Please make a PR and I'll be happy to review as soon as I can.

LuisRodriguezLD avatar Sep 30 '24 16:09 LuisRodriguezLD

Completed #52

LuisRodriguezLD avatar Oct 14 '24 13:10 LuisRodriguezLD

Hi Luis,

I hope you're doing well! I’ve been investigating an issue with the settings.js file in the project after my contribution, and I’ve come across a few things I’d like to clarify:

File History: I noticed that the settings.js file was merged into the v1 branch, but it appears to have become empty during the merge. The last commit to the file (9d741f9) shows it was resolved as an empty file due to a merge conflict, and it has remained empty in the master branch since then.

Missing Core Calendar Logic: This file contains critical functionality for the calendar behavior, so it seems unusual that the project is running without this content. Could you help me understand how the application is functioning properly without it? Is the calendar logic being handled elsewhere now, or was there an oversight during the merge?

Missing 'Full Day' Setting: Additionally, I’ve noticed that the 'fullday' setting didn’t fully make it into the working V1 calendar plugin. Despite the merge being approved, this option seems to be missing in the final implementation. Can you shed some light on this?

Next Steps: Would it be possible to restore the previous version of the file (from commit e84e1b3) and push it to the repository? Also, has there been a change in how the calendar functionality is being implemented, or is this a potential oversight?

Looking forward to your feedback, and thank you for your time!

Jacob

Jacob-Daniel avatar Feb 27 '25 09:02 Jacob-Daniel