TodoList
TodoList copied to clipboard
Add ability to show holidays in calendar view.
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; }
}
}
Hi I would like to work on this. Can I be assigned to this?
Hi I would like to work on this. Can I be assigned to this?
Yes, thanks. Let me know if you have any questions.
Is this closed? I can have a look at it if it is still open?
Please take it @gdhumal
@amoraitis , @gdhumal is this issue still open for contribution?
@amoraitis , @gdhumal is this issue still open for contribution?
@prasadtelkikar Yes, you can take it.
@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.
@hc-codes Just a calendar view of tasks. You can generate the experience you like.