Working with WPF Calendar Management (C #), Hebrew Date Conversion and Geography

I need to create a simple application, Notes calendar, working with simple db and standard calendar, is simple. The problem is related to the function I have to add:

I need each note to have a Hebrew date and a Georgian date; It should work on the fly, that is: the user will be able to add a note based on the type of date of his choice, Georgian or Hebrew, and the application will do the magic in the background.

db will only work with Georgian dates, so no conversion is required.

I need (and a lot of searching helped very little) a tutorial for this, any help will help.

+3
source share
1 answer

How about this?

private static string GetHebDate(DateTime date, string format)
        {

            System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("he-IL");
            ci.DateTimeFormat.Calendar = new System.Globalization.HebrewCalendar();
            return date.ToString(format, ci);

        }
+5
source

Source: https://habr.com/ru/post/1769263/


All Articles