Date celltype showing time part

Posted by: tosch on 8 September 2017, 1:37 pm EST

  • Posted 8 September 2017, 1:37 pm EST

    I have written my own DateTime celltype and also a date subeditor.

    When I doubleclick the cell when in edit mode the subeditor is shown, I can select a date and end the subeditor. 

    showing the subeditor but still in editmode the date including the time
    is shown in the cell although I have formatted the date to have the
    dd/MM/yyyy format.


    I'm (pretty) sure there is nothing wrong wrong with my code and believe spread is showing the date with the wrong format.

    is a small sample app with two columns with my own dateformat and one
    with the spread date format. To show the problem double click a cell,
    double click again to show the sub editor, select a date and click ok.
    Now you will see something like 13.11.2008 00:00:00 in the cell.


  • Replied 8 September 2017, 1:37 pm EST


    In the GetValue method, you were returning a Date object, which includes a date and time. You need to change that code to return only the date.

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Public</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Function</FONT></FONT><FONT size=2> GetValue() </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Object</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Implements</FONT></FONT><FONT size=2> FarPoint.Win.Spread.CellType.ISubEditor.GetValue

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>' Return Cal.SelectionStart.Date

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Return</FONT></FONT><FONT size=2> Format(Cal.SelectionStart, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"dd/MM/yyyy"</FONT></FONT><FONT size=2>)

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Function

  • Replied 8 September 2017, 1:37 pm EST

    cool, thanks for your help.

    I believed that if I returned .Date it was a date only without time part.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels