kandi background
Explore Kits

Hijri-Calendar | Hijri Calendar - التقويم الهجري | Calendar library

 by   abodehq Java Version: Current License: No License

 by   abodehq Java Version: Current License: No License

Download this library from

kandi X-RAY | Hijri-Calendar Summary

Hijri-Calendar is a Java library typically used in User Interface, Calendar applications. Hijri-Calendar has no bugs, it has no vulnerabilities and it has low support. However Hijri-Calendar build file is not available. You can download it from GitHub.
Hijri Calendar - التقويم الهجري.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • Hijri-Calendar has a low active ecosystem.
  • It has 17 star(s) with 16 fork(s). There are 3 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 3 open issues and 0 have been closed. On average issues are closed in 2358 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of Hijri-Calendar is current.
Hijri-Calendar Support
Best in #Calendar
Average in #Calendar
Hijri-Calendar Support
Best in #Calendar
Average in #Calendar

quality kandi Quality

  • Hijri-Calendar has 0 bugs and 0 code smells.
Hijri-Calendar Quality
Best in #Calendar
Average in #Calendar
Hijri-Calendar Quality
Best in #Calendar
Average in #Calendar

securitySecurity

  • Hijri-Calendar has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • Hijri-Calendar code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
Hijri-Calendar Security
Best in #Calendar
Average in #Calendar
Hijri-Calendar Security
Best in #Calendar
Average in #Calendar

license License

  • Hijri-Calendar does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.
Hijri-Calendar License
Best in #Calendar
Average in #Calendar
Hijri-Calendar License
Best in #Calendar
Average in #Calendar

buildReuse

  • Hijri-Calendar releases are not available. You will need to build from source code and install.
  • Hijri-Calendar has no build file. You will be need to create the build yourself to build the component from source.
Hijri-Calendar Reuse
Best in #Calendar
Average in #Calendar
Hijri-Calendar Reuse
Best in #Calendar
Average in #Calendar
Top functions reviewed by kandi - BETA

kandi has reviewed Hijri-Calendar and discovered the below as its top functions. This is intended to give you an instant insight into Hijri-Calendar implemented functionality, and help decide if they suit your requirements.

  • Set the date view .
    • Checks the existence of the declaring day .
      • Calculate the Pegasus for a moon phase .
        • Calculates the Julian date .
          • Convert a Sketch to a IRCh symbol .
            • Calculates a MiniMoon for a given value
              • Calculates the phase .
                • This method is called when a date activity is received .
                  • Called when the calendar is updated .
                    • Initialize the text font .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      Hijri-Calendar Key Features

                      Hijri Calendar - التقويم الهجري

                      Why data cleared from textbox when click enter when converting Hijri date to gregorian Date c# windows application?

                      copy iconCopydownload iconDownload
                          private void hijriDate_KeyDown(object sender, KeyEventArgs e)
                          {
                              if (e.KeyCode == Keys.Return)
                              {
                                  greDate.Text = new Dates().HijriToGreg(hijriDate.Text);
                              }
                          }
                      
                          private void greDate_KeyDown(object sender, KeyEventArgs e)
                          {
                              if (e.KeyCode == Keys.Return)
                              {
                                  hijriDate.Text = new Dates().GregToHijri(greDate.Text);
                              }
                          }
                      
                      private void hijriDate_KeyDown(object sender, KeyEventArgs e)
                              {
                                  if (e.KeyCode == Keys.Return)
                      
                                      {
                                      greDate.Text = date.HijriToGreg(hijriDate.Text);
                                      int age = (int)((DateTime.Now - Convert.ToDateTime(greDate.Text)).TotalDays / 365.242199);
                                      textAge.Text =  age.ToString();
                                      greDate.Focus();
                                  }
                      
                              }
                      

                      Community Discussions

                      Trending Discussions on Hijri-Calendar
                      • Why data cleared from textbox when click enter when converting Hijri date to gregorian Date c# windows application?
                      Trending Discussions on Hijri-Calendar

                      QUESTION

                      Why data cleared from textbox when click enter when converting Hijri date to gregorian Date c# windows application?

                      Asked 2020-Jan-11 at 19:46

                      I want to convert Hijri Date to Gregorian date and vise versa, I found the following solution class in this link

                      https://www.codeproject.com/Articles/8838/Convert-date-from-Hijri-Calendar-to-Gregorian-Cale?msg=5688246#xx5688246xx

                      I tried the class code :

                      using System;
                      using System.Web;
                      using System.Diagnostics;
                      using System.Globalization;
                      using System.Data;
                      using System.Collections;
                      
                      namespace Bahsas
                      {
                          /// <summary>
                          /// Summary description for Dates.
                          /// </summary>
                          public class Dates
                          {
                              private HttpContext cur;
                      
                              private const int startGreg=1900;
                              private const int endGreg=2100;
                              private string[] allFormats={"yyyy/MM/dd","yyyy/M/d",
                                  "dd/MM/yyyy","d/M/yyyy",
                                  "dd/M/yyyy","d/MM/yyyy","yyyy-MM-dd",
                                  "yyyy-M-d","dd-MM-yyyy","d-M-yyyy",
                                  "dd-M-yyyy","d-MM-yyyy","yyyy MM dd",
                                  "yyyy M d","dd MM yyyy","d M yyyy",
                                  "dd M yyyy","d MM yyyy"};
                              private CultureInfo arCul;
                              private CultureInfo enCul;
                              private HijriCalendar h;
                              private GregorianCalendar g;
                      
                              public Dates()
                              {
                                  cur = HttpContext.Current;
                      
                                  arCul=new CultureInfo("ar-SA");
                                  enCul=new CultureInfo("en-US");
                      
                                  h=new  HijriCalendar();
                                  g=new GregorianCalendar(GregorianCalendarTypes.USEnglish);
                      
                                  arCul.DateTimeFormat.Calendar=h;           
                              }
                      
                                 /// <summary>
                              /// Check if string is hijri date and then return true 
                              /// </summary>
                              /// <PARAM name="hijri"></PARAM>
                              /// <returns></returns>
                              public bool IsHijri(string hijri)
                              {
                                  if (hijri.Length<=0)
                                  {
                      
                                      cur.Trace.Warn("IsHijri Error: Date String is Empty");
                                      return false;
                                  }
                                  try
                                  {    
                                      DateTime tempDate=DateTime.ParseExact(hijri,allFormats,
                                           arCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      if (tempDate.Year>=startGreg && tempDate.Year<=endGreg)
                                          return true;
                                      else
                                          return false;
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("IsHijri Error :"+hijri.ToString()+"\n"+
                                                        ex.Message);
                                      return false;
                                  }
                              }
                              /// <summary>
                              /// Check if string is Gregorian date and then return true 
                              /// </summary>
                              /// <PARAM name="greg"></PARAM>
                              /// <returns></returns>
                              public bool IsGreg(string greg)
                              {
                                  if (greg.Length<=0)
                                  {
                      
                                      cur.Trace.Warn("IsGreg :Date String is Empty");
                                      return false;
                                  }
                                  try
                                  {    
                                      DateTime tempDate=DateTime.ParseExact(greg,allFormats,
                                          enCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      if (tempDate.Year>=startGreg && tempDate.Year<=endGreg)
                                          return true;
                                      else
                                          return false;
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("IsGreg Error :"+greg.ToString()+"\n"+ex.Message);
                                      return false;
                                  }
                              }
                      
                              /// <summary>
                              /// Return Formatted Hijri date string 
                              /// </summary>
                              /// <PARAM name="date"></PARAM>
                              /// <PARAM name="format"></PARAM>
                              /// <returns></returns>
                              public string FormatHijri(string date ,string format)
                              {
                                  if (date.Length<=0)
                                  {                
                                      cur.Trace.Warn("Format :Date String is Empty");
                                      return "";
                                  }
                                  try
                                  {                       
                                      DateTime tempDate=DateTime.ParseExact(date,
                                         allFormats,arCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      return tempDate.ToString(format,arCul.DateTimeFormat);                            
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("Date :\n"+ex.Message);
                                      return "";
                                  }
                              }
                              /// <summary>
                              /// Returned Formatted Gregorian date string
                              /// </summary>
                              /// <PARAM name="date"></PARAM>
                              /// <PARAM name="format"></PARAM>
                              /// <returns></returns>
                              public string FormatGreg(string date ,string format)
                              {
                                  if (date.Length<=0)
                                  {                
                                      cur.Trace.Warn("Format :Date String is Empty");
                                      return "";
                                  }
                                  try
                                  {
                                      DateTime tempDate=DateTime.ParseExact(date,allFormats,
                                          enCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      return tempDate.ToString(format,enCul.DateTimeFormat);                            
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("Date :\n"+ex.Message);
                                      return "";
                                  }
                              }
                              /// <summary>
                              /// Return Today Gregorian date and return it in yyyy/MM/dd format
                              /// </summary>
                              /// <returns></returns>
                              public string GDateNow()
                              {
                                  try
                                  {
                                      return DateTime.Now.ToString("yyyy/MM/dd",enCul.DateTimeFormat);
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("GDateNow :\n"+ex.Message);
                                      return "";
                                  }
                              }
                              /// <summary>
                              /// Return formatted today Gregorian date based on your format
                              /// </summary>
                              /// <PARAM name="format"></PARAM>
                              /// <returns></returns>
                              public string GDateNow(string format)
                              {
                                  try
                                  {
                                      return DateTime.Now.ToString(format,enCul.DateTimeFormat);
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("GDateNow :\n"+ex.Message);
                                      return "";
                                  }
                              } 
                      
                              /// <summary>
                              /// Return Today Hijri date and return it in yyyy/MM/dd format
                              /// </summary>
                              /// <returns></returns>
                              public string HDateNow()
                              {
                                  try
                                  {
                                      return DateTime.Now.ToString("yyyy/MM/dd",arCul.DateTimeFormat);
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("HDateNow :\n"+ex.Message);
                                      return "";
                                  }
                              }
                              /// <summary>
                              /// Return formatted today hijri date based on your format
                              /// </summary>
                              /// <PARAM name="format"></PARAM>
                              /// <returns></returns>
                      
                              public string HDateNow(string format)
                              {
                                  try
                                  {
                                      return DateTime.Now.ToString(format,arCul.DateTimeFormat);
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("HDateNow :\n"+ex.Message);
                                      return "";
                                  }            
                              }
                      
                              /// <summary>
                              /// Convert Hijri Date to it's equivalent Gregorian Date
                              /// </summary>
                              /// <PARAM name="hijri"></PARAM>
                              /// <returns></returns>
                              public string HijriToGreg(string hijri)
                              {            
                                  if (hijri.Length<=0)
                                  {
                      
                                      cur.Trace.Warn("HijriToGreg :Date String is Empty");
                                      return "";
                                  }
                                  try
                                  {
                                      DateTime tempDate=DateTime.ParseExact(hijri,allFormats,
                                         arCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      return tempDate.ToString("yyyy/MM/dd",enCul.DateTimeFormat);
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("HijriToGreg :"+hijri.ToString()+"\n"+ex.Message);
                                      return "";
                                  }
                              }
                              /// <summary>
                              /// Convert Hijri Date to it's equivalent Gregorian Date
                              /// and return it in specified format
                              /// </summary>
                              /// <PARAM name="hijri"></PARAM>
                              /// <PARAM name="format"></PARAM>
                              /// <returns></returns>
                              public string HijriToGreg(string hijri,string format)
                              {
                                  if (hijri.Length<=0)
                                  {
                                      cur.Trace.Warn("HijriToGreg :Date String is Empty");
                                      return "";
                                  }
                                  try
                                  {
                                      DateTime tempDate=DateTime.ParseExact(hijri,
                                         allFormats,arCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      return tempDate.ToString(format,enCul.DateTimeFormat);
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("HijriToGreg :"+hijri.ToString()+"\n"+ex.Message);
                                      return "";
                                  }
                              }
                              /// <summary>
                              /// Convert Gregoian Date to it's equivalent Hijir Date
                              /// </summary>
                              /// <PARAM name="greg"></PARAM>
                              /// <returns></returns>
                              public string GregToHijri(string greg)
                              {
                                  if (greg.Length<=0)
                                  {
                                      cur.Trace.Warn("GregToHijri :Date String is Empty");
                                      return "";
                                  }
                                  try
                                  {
                                      DateTime tempDate=DateTime.ParseExact(greg,allFormats,
                                          enCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      return tempDate.ToString("yyyy/MM/dd",arCul.DateTimeFormat);                
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("GregToHijri :"+greg.ToString()+"\n"+ex.Message);
                                      return "";
                                  }
                              }
                              /// <summary>
                              /// Convert Hijri Date to it's equivalent Gregorian Date and
                              /// return it in specified format
                              /// </summary>
                              /// <PARAM name="greg"></PARAM>
                              /// <PARAM name="format"></PARAM>
                              /// <returns></returns>
                              public string GregToHijri(string greg,string format)
                              {            
                                  if (greg.Length<=0)
                                  {                
                                      cur.Trace.Warn("GregToHijri :Date String is Empty");
                                      return "";
                                  }
                                  try
                                  {               
                                      DateTime tempDate=DateTime.ParseExact(greg,allFormats,
                                          enCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      return tempDate.ToString(format,arCul.DateTimeFormat);                
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("GregToHijri :"+greg.ToString()+"\n"+ex.Message);
                                      return "";
                                  }
                              }
                      
                              /// <summary>
                              /// Return Gregrian Date Time as digit stamp
                              /// </summary>
                              /// <returns></returns>
                              public string GTimeStamp()
                              {
                                  return GDateNow("yyyyMMddHHmmss");
                              }
                              /// <summary>
                              /// Return Hijri Date Time as digit stamp
                              /// </summary>
                              /// <returns></returns>
                              public string HTimeStamp()
                              {
                                  return HDateNow("yyyyMMddHHmmss");
                              }
                      
                              /// <summary>
                              /// Compare two instances of string date 
                              /// and return indication of their values 
                              /// </summary>
                              /// <PARAM name="d1"></PARAM>
                              /// <PARAM name="d2"></PARAM>
                              /// <returns>positive d1 is greater than d2,
                              /// negative d1 is smaller than d2, 0 both are equal</returns>
                              public int Compare(string d1,string d2)
                              {
                                  try
                                  {
                                      DateTime date1=DateTime.ParseExact(d1,allFormats,
                                          arCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      DateTime date2=DateTime.ParseExact(d2,allFormats,
                                          arCul.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);
                                      return DateTime.Compare(date1,date2);
                                  }
                                  catch (Exception ex)
                                  {
                                      cur.Trace.Warn("Compare :"+"\n"+ex.Message);
                                      return -1;
                                  }
                              }
                          }
                      }
                      

                      Then i created 2 textbox HijriDate and GreDate and i need for example when write the date in gregorian and click ENTER to convert it to Hijri and vise versa . I tried the following code :

                      private void hijriDate_KeyDown(object sender, KeyEventArgs e)
                      {
                          if (e.KeyCode == Keys.Return)
                          {
                            greDate.text =  date.HijriToGreg(hijriDate.Text);
                          }
                      }
                      
                      private void greDate_KeyDown(object sender, KeyEventArgs e)
                      {
                          if (e.KeyCode == Keys.Return)
                          {
                             hijriDate.text =  date.GregToHijri(greDate.Text);
                          } 
                      }
                      

                      When i type hijri date in hijridate textbox and click ENTER the date in Hijridate textbox cleared and converted to gregorian date in greDate textbox , also When i type gregorian date in gredate textbox and click ENTER the date in gredate textbox cleared and converted to hijri date in hijridate textbox why its cleared and how i will keep both dates hijri date and gregorian date?

                      ANSWER

                      Answered 2020-Jan-07 at 13:25

                      Did you verify the dates in respective variables? It may be that pressing 'Enter' has moved the text so it is not visible on screen.


                      I wrote the following code and it is working fine:

                          private void hijriDate_KeyDown(object sender, KeyEventArgs e)
                          {
                              if (e.KeyCode == Keys.Return)
                              {
                                  greDate.Text = new Dates().HijriToGreg(hijriDate.Text);
                              }
                          }
                      
                          private void greDate_KeyDown(object sender, KeyEventArgs e)
                          {
                              if (e.KeyCode == Keys.Return)
                              {
                                  hijriDate.Text = new Dates().GregToHijri(greDate.Text);
                              }
                          }
                      

                      Source https://stackoverflow.com/questions/59623038

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install Hijri-Calendar

                      You can download it from GitHub.
                      You can use Hijri-Calendar like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Hijri-Calendar component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular Calendar Libraries
                      Try Top Libraries by abodehq
                      Compare Calendar Libraries with Highest Support
                      Compare Calendar Libraries with Highest Quality
                      Compare Calendar Libraries with Highest Security
                      Compare Calendar Libraries with Permissive License
                      Compare Calendar Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.