Fix date issue in Google Feed.

This commit is contained in:
2025-06-28 13:24:41 -04:00
parent aeb820c5fb
commit ec3b14efa3

View File

@@ -4574,8 +4574,7 @@ namespace MarketData.Helper
return null;
}
DateTime currentMarketDate=PremarketDA.GetLatestMarketDate();
// LatestPriceDelegate[] latestPriceDelegates=new LatestPriceDelegate[]{GetLatestPriceYahoo,GetLatestPriceBigCharts,GetLatestPriceBarChart,GetLatestPriceGoogle};
LatestPriceDelegate[] latestPriceDelegates=new LatestPriceDelegate[]{GetLatestPriceYahoo,GetLatestPriceBigCharts,GetLatestPriceGoogle};
LatestPriceDelegate[] latestPriceDelegates=new LatestPriceDelegate[]{GetLatestPriceYahoo,GetLatestPriceBigCharts,GetLatestPriceGoogle,GetLatestPriceBarChart};
Price latestPrice=null;
foreach(LatestPriceDelegate latestPriceDelegate in latestPriceDelegates)
{
@@ -4939,7 +4938,6 @@ namespace MarketData.Helper
HtmlNode softTimeNode = htmlDocument.DocumentNode.SelectSingleNode("//*[@class=\"soft time\"]");
if(null!=softTimeNode)
{
// DateTime givenDate=Utility.ParseDate(softTimeNode.InnerHtml);
DateTime givenDate=ConvertBigChartsDate(softTimeNode.InnerHtml);
if(!Utility.IsEpoch(givenDate))price.Date=givenDate;
}
@@ -5015,6 +5013,8 @@ namespace MarketData.Helper
HttpNetResponse httpNetResponse=null;
try
{
DateGenerator dateGenerator = new DateGenerator();
DateTime pricingDate = dateGenerator.GetPrevBusinessDay(DateTime.Now);
StringBuilder sb = new StringBuilder();
String strRequest;
if(null==symbol) return null;
@@ -5065,7 +5065,7 @@ namespace MarketData.Helper
price.Source=Price.PriceSource.Google;
price.Close=price.Open=price.High=price.Low=price.AdjClose=double.NaN;
price.Open=0.00;
price.Date = DateTime.Now;
price.Date = pricingDate;
if(Sections.FindInSections(sections, "After Hours:", 0,ref index, true))
{
@@ -5170,6 +5170,13 @@ namespace MarketData.Helper
MDTrace.WriteLine(LogLevel.DEBUG, exception.ToString());
return null;
}
finally
{
if (null != httpNetResponse)
{
httpNetResponse.Dispose();
}
}
}
private static Dictionary<String, double> CreateBarChartValues(String[] pairs)