Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Dec 02, 2009 21:36
open dhtmlx forum
date formating like 24.nov

Hello,

IN my below code i ma applying the manual calendar . this calendar must be shown in the date feromat is dd-mm-yyy but i have to shown this date in the date and month only ex:- 24.nov lie this and also if i add the date maually like 24.nov then automatically it will updated in the database .tell me the code wht i do to change the code also i am apply to change the sql query like date_fomat('%d,,%m,end_date) as end_date so it give me error in my sql .

so please give me the solution of this problem as soon as possible.

below is the my code . on this page i ahve to apply the query like date format


connnctor.php

<?php     $res=mysql_connect("localhost","root","");

    mysql_select_db("sampledb");

    require_once("../dhtmlxConnector_php/codebase/grid_connector.php");

    $grid = new GridConnector($res);

    $grid->dynamic_loading(100);

    $grid->render_table("products","nm","code,num_val,shotid,shotstatus,taskid,taskref,tasknote,userid,taskstatus,start_date,end_date,alloted_mandays,task_priority,next_sub,actual_manday");





?>

below is my sample.html file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

    <link rel='STYLESHEET' type='text/css' href='../dhtmlxGrid/codebase/dhtmlxgrid.css'>

    <link href='../dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn_bricks.css' rel='STYLESHEET' type='text/css'>

<link rel="STYLESHEET" type="text/css" href="../dhtmlxGrid/codebase/calendar/dhtmlxcalendar.css">

    

    <script src='../dhtmlxGrid/codebase/dhtmlxcommon.js'></script>

    <script src='../dhtmlxGrid/codebase/dhtmlxgrid.js'></script>    

    <script src='../dhtmlxGrid/codebase/dhtmlxgridcell.js'></script>    

    <script src='../dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js'></script>    

<script src='../dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js'></script>    



    <script src='../dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js'></script>

<script src='../dhtmlxConnector_PHP/codebase/connector.js'></script>





<script src="../dhtmlxGrid/codebase/calendar/dhtmlxcalendar.js"></script>

<script src="../dhtmlxGrid/codebase/calendar/excelll/dhtmlxgrid_excell_dhxcalendar.js"></script>

<link rel="STYLESHEET" type="text/css" href="../../../dhtmlxCalendar/codebase/skins/dhtmlxcalendar_yahoolike.css">



</head>



<body>

    

<div id="gridbox" style="width:1000px; height:902px;"></div>



<script>

    mygrid = new dhtmlXGridObject('gridbox');

    mygrid.setImagePath('dhtmlxGrid/codebase/imgs/');

    mygrid.setHeader("ID,Name,shotID,shotstatus,taskid,taskref,userID,taskStatus,startdate,enddate,alloted mandays,task priority,next sub,actual mandays");

    mygrid.setInitWidths("100,*")

    mygrid.setColTypes("ed,ed,ed,ed,ed,ed,ed,ed,ed,dhxCalendarA,ed,ed,ed,ed");

    mygrid.setSkin("modern")

    mygrid.attachHeader("#connector_text_filter,#connector_select_filter,#connector_text_filter,#connector_select_filter,#connector_text_filter,#connector_select_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter")

    

    mygrid.setColSorting("connector,int,connector")



    mygrid.init();

    mygrid.enableSmartRendering(true);

    mygrid.enableMultiselect(true);

        mygrid.loadXML("connector.php");

    var dp = new dataProcessor("connector.php");

    dp.init(mygrid);

    

    

    

</script>

</body>

</html>




please reoplky me as soon as possible.










Answer posted by dhxSupport on Dec 03, 2009 02:34
If you want to use dhxCalendar type your server side code should return xml with values in necessary format. If you are using dhtlxConnector you add should few lines of code to your server side to format values before sending them to the client side. Please check this article http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxconnector:formatting_changing_data_before_loading
Other useful dhtmlxConnector topics are available here http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxconnector:toc_what_is_dhtmlxconnector

Besides on the client side you should define date format with setDateFormat() method. http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_setdateformat
http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:formatting_date_values