Help with Calendar

(10 posts) (2 voices)

Tags:

  1. ziuras, Member

    Hi, i need help with calendar

    When I watch the calendar in demo site, i see calendar in my language (with first day of week Monday, week days in Lithuanian, but time format is 4p:00)
    But when i create calendar in my own server i see calendar in English (fdow: sunday, weekdays in english, time 16:00)

    How and where to change calendar locale and time format?

  2. myDBR Team, Key Master

    Check the myDBR's preferences what language and time format has been set. Both the calendar's language and time format is based on those settings.

    --
    myDBR Team

  3. ziuras, Member

    Hi, thanks for preferences.

  4. ziuras, Member

    Another question:
    After "New entry" or after "Delete entry" calendar not refreshing automaticaly.
    I need refresh browser (F5) or run report again.
    ~~~~~~
    Delete procedure:

    create procedure sp_DBR_Xrpt021_Posedziai_Calendar_Delete (@in_id bigint)
    as begin
    delete from CelsisNorma.dbo.Xrpt021_Posedziai where Id = @in_id
    select 'dbr.javascript', "$('.mycal').fullCalendar( 'refetchEvents' )";
    end

    ~~~~~~
    New procedure:

    create procedure sp_DBR_Xrpt021_Posedziai_Calendar_New (@in_calendar_id varchar(12), @in_from datetime, @in_to datetime, @in_entry varchar(1000))
    as begin
    insert into CelsisNorma.dbo.Xrpt021_Posedziai ( Kabinetas, Nuo, Iki, Pastaba )
    values ( @in_calendar_id, @in_from, @in_to, @in_entry );
    select 'dbr.javascript', "$('.mycal').fullCalendar( 'refetchEvents' )";
    end

    ~~~~~~
    Calendar data:
    ~~~~~~
    create procedure sp_DBR_Xrpt021_Posedziai_Calendar_Data (@in_from date, @in_to date, @in_calendar_id varchar(12))
    as begin
    select 'dbr.cellstyle', 'entry', 'style'
    select 'dbr.calendar.options', 'editable', '', 'sp_DBR_Xrpt021_Posedziai_Calendar_Edit', 'id'
    select 'dbr.report', 'sp_DBR_Xrpt021_Posedziai_Calendar_Delete','[entry]', 'in_id=id', "misc[]", 'callbefore=confirmdel', '"dbr.html:<span style="color:red">Delete event</span>"';
    select 'dbr.calendar.options', 'event.id', 'id'; SELECT Nuo as datetime_from, Iki as datetime_to, Pastaba as entry, Style as style, ID as id
    FROM CelsisNorma.dbo.Xrpt021_Posedziai
    where Kabinetas=@in_calendar_id and cast(Nuo as date) <= @in_to and isnull(cast(Iki as date), @in_from) >= @in_from;
    end
    ~~~~~~
    Calendar:
    ~~~~~~
    create procedure sp_DBR_Xrpt021_Posedziai_Calendar (@in_calendar_id varchar(12))
    as begin
    select 'dbr.javascript','
    function confirmdel(obj) {
    return confirm("Are you sure you want to delete the entry?");
    }';
    select 'dbr.calendar', 1000;
    select 'dbr.calendar.report', 'sp_DBR_Xrpt021_Posedziai_Calendar_Data', @in_calendar_id
    select 'dbr.calendar.options', 'new', 'newentry', 2;
    select 'dbr.calendar.options', 'selectable', 1;
    select 'dummy';
    select 'dbr.button', '<i class="fa fa-plus" aria-hidden="true"></i> New calendar entry', 'newentry button';
    select 'dbr.report', 'sp_DBR_Xrpt021_Posedziai_Calendar_New', 'misc[]', 'in_calendar_id=in_calendar_id'
    select @in_calendar_id as 'in_calendar_id'
    end

    ~~~~~~

  5. myDBR Team, Key Master

    You seem to be missing the:

    select 'dbr.resultclass', 'mycal';

    from the sp_DBR_Xrpt021_Posedziai_Calendar-routine. You are using the jQuery call $('.mycal') which will point to that calendar once the class is added.

    --
    myDBR Team

  6. ziuras, Member

    Thanks it works now.
    Can you hide my code or rename tables :)

  7. ziuras, Member

    And in documentation there are nothing about "select 'dbr.resultclass', 'mycal';"

  8. ziuras, Member

    Another question:
    is it possible to edit the entry text?

  9. myDBR Team, Key Master

    Sure,
    just create a linked report for the entry popup. The linked report updates the entry text and refreshes the calendar.

    In `sp_DBR_Xrpt021_Posedziai_Calendar_Data` do:

    select 'dbr.report', 'sp_DBR_Xrpt021_Posedziai_Calendar_Edit', '[entry]', 'dynamic_div[]', 'in_id=id', 'in_entry<=entry';

    And the linked report could look like this:

    create procedure sp_DBR_Xrpt021_Posedziai_Calendar_Edit(
    in_id int,
    in_entry varchar(1000)
    )
    begin update CelsisNorma.dbo.Xrpt021_Posedziai
    set Pastaba=in_entry
    where ID=in_id; select 'dbr.javascript', "$('.mycal').fullCalendar( 'refetchEvents' );"; end

    --
    myDBR Team

  10. ziuras, Member

    Thanks


Reply

You must log in to post.