Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1414
Displaying Schedules in a WebGrid
posted

To All,

I have posted a question in the WebGrid section of this forum.  I tracked down the stored procedure to retrieve a Resources schedule from the Infragistics supplied tables and have modified it so that I can include multiple resources (not just one at a time) - basically, use a SQL IN clause to generate a SQL string for a call to a SQL Server.  I found the Infragistic stuff very slick - and rather open.

However, the dates are stored in Universal Time.

They are displayed in the appointments form in Local Time.

Is there a way to replicate this easily when displaying the data in an Infragistics grid?  I thought it might be a column property, but now I am thinking it might be something algorithmic hidden in the scheduler tools.

R/S,
Roger

  • 2636
    posted

    Semper Fi,

    Since you have modified the stored procedure just execute the below code in SQL then call it in your select statement

     to call below code just do something like
    SELECT
    ActivityID,
    StartDate = dbo.functionConvertUTC(startdatetimeutc)
    ...

    //SQL CODE

    CREATE FUNCTION functionConvertUTC (@UTCDate datetime)
    RETURNS datetime
    AS
    BEGIN
    DECLARE
    @LocalDate datetime
    DECLARE
    @TimeDiff int
    DECLARE @CLT datetime

    SET @LocalDate = GETDATE()
    SET @TimeDiff = DATEDIFF(hh, @UTCDate, @LocalDate)
    SET @CLT = DATEADD(hh, @TimeDiff, @UTCDate)

    RETURN @CLT
    END