Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to show holidays in calendar view. #75

Open
amoraitis opened this issue Jun 8, 2020 · 10 comments
Open

Add ability to show holidays in calendar view. #75

amoraitis opened this issue Jun 8, 2020 · 10 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@amoraitis
Copy link
Owner

amoraitis commented Jun 8, 2020

Is your feature request related to a problem? Please describe.
The user will have the ability to import holidays as tasks to the monthly calendar view.

Describe the solution you'd like
Add a new Model class under TodoList/TodoList.Core/Models/:
This will need a new migration for the new UserPreferences table.

class UserPreferences
// In iso-3166 format. 1 for now. _In the future create a config value to support multiple countries._
+ UserId: Guid[Key. 1-1 relationship to ApplicationUser.Id]
+ HolidaysInCountry : string

Use Calendarific which offers 1000 free requests/month.

A clear and concise description of any alternative solutions or features you've considered.

Add an HttpClient. Preferably create an IHolidaysCalendarService interface and an implementation of that at HolidaysCalendarService. Investiagate what methods we will need.

Create front-end code that updates the preferences. In the Calendar view or in the user's account menu(add as user preferences tab). This will automatically attach all holidays when navigating to calendar if UserPreferences.HolidaysInCountries is not null in the DB. So, TodosController.Home() Action will also return a list of holidays to be presented. Prepare the View to show the new Data in the same way the existing TODOs do.

  • Add new List of countries to options, preferably a .json file under a /.content folder.
    Use the response from this request.
  • Add new key-value pair to secrets.json for Calendarific's API key. And base URL to the appsettings.json.

Additional context

Holidays response as documented here:
Create this under TodoList/TodoList.Core/Responses/

namespace TodoList.Core.Responses
{
    using System;
    using System.Collections.Generic;

    using System.Globalization;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;

    public partial class HolidaysResponse
    {
        [JsonProperty("meta")]
        public Meta Meta { get; set; }

        [JsonProperty("response")]
        public Response Response { get; set; }
    }

    public partial class Meta
    {
        [JsonProperty("code")]
        public long Code { get; set; }
    }

    public partial class Response
    {
        [JsonProperty("holidays")]
        public Holiday[] Holidays { get; set; }
    }

    public partial class Holiday
    {
        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("description")]
        public string Description { get; set; }

        [JsonProperty("date")]
        public Date Date { get; set; }

        [JsonProperty("type")]
        public string[] Type { get; set; }
    }

    public partial class Date
    {
        [JsonProperty("iso")]
        public DateTimeOffset Iso { get; set; }

        [JsonProperty("datetime")]
        public Datetime Datetime { get; set; }
    }

    public partial class Datetime
    {
        [JsonProperty("year")]
        public long Year { get; set; }

        [JsonProperty("month")]
        public long Month { get; set; }

        [JsonProperty("day")]
        public long Day { get; set; }
    }
}
@amoraitis amoraitis added enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed labels Oct 3, 2020
@gabrielatricak
Copy link

Hi I would like to work on this. Can I be assigned to this?

@amoraitis
Copy link
Owner Author

Hi I would like to work on this. Can I be assigned to this?

Yes, thanks. Let me know if you have any questions.

@gdhumal
Copy link

gdhumal commented Jul 3, 2021

Is this closed? I can have a look at it if it is still open?

@amoraitis
Copy link
Owner Author

Please take it @gdhumal

@prasadtelkikar
Copy link

@amoraitis , @gdhumal is this issue still open for contribution?

@amoraitis
Copy link
Owner Author

@amoraitis , @gdhumal is this issue still open for contribution?

@prasadtelkikar
Yes, you can take it.

@hc-codes
Copy link

@amoraitis is this issue still open for contribution. If yes, can I get more information on what exactly is needed in terms of user experience.

@amoraitis
Copy link
Owner Author

@hc-codes Just a calendar view of tasks. You can generate the experience you like.

@gabyslaw
Copy link

Hi @amoraitis, Is this still open? if yes, can you assign to me, give me the details and assist check the this restcountries url as it seems to have broken.

If no, can I get a list of currently open issues that can be looked into.

Thanks.

@amoraitis
Copy link
Owner Author

Hi @amoraitis, Is this still open? if yes, can you assign to me, give me the details and assist check the this restcountries url as it seems to have broken.

If no, can I get a list of currently open issues that can be looked into.

Thanks.

@gabyslaw you can use an export from this url https://public.opendatasoft.com/explore/dataset/countries-codes/table/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants