Arlodotexe / strix-music

Combine any music sources into a single library. It's your music. Play it your way.

Home Page:http://www.strixmusic.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adjust seasonable quips for southern hemisphere

Arlodotexe opened this issue · comments

commented

Background

Right now, when the app is starting up, we display "Quips". These are witty remarks that change depending on language, time of day or year, region, etc., and are meant to entertain the user briefly while the app loads.

Problem

Seasonable quips are based on the current date, but these are based on the dates seasons stop and start for the northern hemisphere. In the sourthern hemisphere, the dates that seasons start and stop are different, meaning anyone using the app in the southern hemisphere will see quips for the wrong season.

Solution

  • Find a way to detect if the user is in the northern or southern hemisphere (without asking for geolocation or making network calls)
  • Adjust date ranges for season quips for both north and south hemisphere.
commented

After a bit of research, I found a trick that may do the job, without needing to map countries to latitude (countries can change).

From what I've read, the Persian calendar starts with the vernal equinox, but always relative to Iran in the north hemisphere. That should mean the date is the same for seasons in both north and south hemisphere, but this needs to be tested.

We need someone in the southern hemisphere to spin up a console app and see what this outputs:

using System;

public class Program
{
    public static void Main()
    {
        var persianMonth = new System.Globalization.PersianCalendar().GetMonth(DateTime.Now);
        var season = (Season)Math.Ceiling(persianMonth / 3.0);
        
        Console.WriteLine(season);
    }

    enum Season
    {
        Spring = 1,
        Summer = 2,
        Autumn = 3,
        Winter = 4
    };
}