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. 

    After
    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.

    Attached
    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.

     


    2008/11/Spreaddate.zip
  • Replied 8 September 2017, 1:37 pm EST

    Tosch,


    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.


    Public Function GetValue() As Object Implements FarPoint.Win.Spread.CellType.ISubEditor.GetValue


    ' Return Cal.SelectionStart.Date


    Return Format(Cal.SelectionStart, "dd/MM/yyyy")


    End 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