2
Vote

There are few bugs with the current release 1.0

description

Hi,
 
I haved fixed some bugs with the converted control to C#:
  1. The convert date function is not needed, you can use the DateTime.Parse() function. Here is the replacement code for the WeatherDate() function:
    public static DateTime WeatherDateToDate(string stringDate)
    {
        try
        {
            return DateTime.Parse(stringDate);
        }
        catch
        {
            //'if there's an error with the xml date string, return the current date
            return DateTime.Now;
        }
    }
     
  2. The date on day of the week is wrong. The current control increments by a whole month and day. Here is the code that will replace the code to determine the day of week:
     
    protected void Page_Load(object sender, EventArgs e)
    {
    ....
     
            //--get base date for showdate in forecast --
            DateTime baseDate = WeatherDateToDate(NodeText(ref xmlDoc, "//weather/dayf/lsup"));
    ....
     
     
    ....
                DateTime curDay = baseDate.AddDays(w);
                fCastWkDay.Text = curDay.ToString("ddd").ToUpper() + "<br/>";
                fCastWkDay.CssClass = fcastWeekdayClass;
                if (showDateInForecast)
                {
                    fCastDate.Text = curDay.ToString("M/dd") + "<br/>";
                    fCastDate.CssClass = fcastDateClass;
                }
     
    ....
     
    }

comments