Jump to content


Photo

DateTime column shows only the date part


  • Please log in to reply
25 replies to this topic

#1 abraham_ll

abraham_ll
  • Members
  • 30 posts

Posted 03 May 2006 - 07:10 PM

Hello,

How can I have the full DateTime (date and time) displayed?

Thanks
Abraham

#2 Vu Quang Thang

Vu Quang Thang
  • Members
  • 91 posts

Posted 27 January 2007 - 08:35 PM

QUOTE (abraham_ll @ May 4 2006, 01:10 AM) <{POST_SNAPBACK}>
Hello,
How can I have the full DateTime (date and time) displayed?
Thanks



Yes. I have the same problem. I spent one day to make a form. Everything was fine and at last I found the Date column doesn't show the time part. FormatMask does not work. I wish that it will be implemented in the next release.

Thanks

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 27 January 2007 - 10:11 PM

Hello,

Unfortunately, this is only DateColumn. If you are agree, I will speed up developing TimeColumn. You may post here how do you like that this column work.

Thank you.

regards

One change,

I have add Time support to DateColumn. But, I think that having TimeColumn is good idea.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 Vu Quang Thang

Vu Quang Thang
  • Members
  • 91 posts

Posted 28 January 2007 - 10:38 AM

Hello Boki,

I think it is good if you create two more columns: TimeColumn and DateTimeColumn. How it works?

For the TimeColumn:
- It can be edited in a spinedit
- It can be sorted by Time value

For the DateTimeColumn
- It can be edited in a spinedit or Calendar Pickup
- It can be sorted by DateTime value

In addition, the two columns can have its own date, time formats or it can use the system setting values in TFormatSettings (in unit SysUtils). For me, it should have its own formats and independent from the system format.

Regards

#5 konfoo

konfoo
  • Members
  • 7 posts

Posted 28 January 2007 - 11:30 AM

I am also interested in the DateTimeColumn and TimeColumn.

Idea for a TimeColumn picker: an analog clock with an AM/PM toggle and Set button (like Raize components).
For DateTimeColumn: anything will do - spinedits below the calendar would be great.

BTW Ability to select HH:MM:SS would be nice (I personally require SS) in the datetimecolumn and timecolumn.

Any ETA for the DateTimeColumn?

Looking forward to this :-)

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 28 January 2007 - 06:12 PM

Hello,

I have already upload files with DateTime support in TNxDateColumn.

I will speed now developement on NxTimeColumn (and NxTimeEdit).

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 konfoo

konfoo
  • Members
  • 7 posts

Posted 28 January 2007 - 08:26 PM

QUOTE (Boki (Berg) @ Jan 28 2007, 09:12 AM) <{POST_SNAPBACK}>
I have already upload files with DateTime support in TNxDateColumn.


Is this in the update package from 2 days ago in the user area? I tried this and my TNxDateColumn still shows only the date. Anything special I have to do, or do I have the wrong version?

Thanks for the hard work as always :-)

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 28 January 2007 - 09:59 PM

Hello,

It seems that I have add it after I release it. I will re-upload it again now.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#9 konfoo

konfoo
  • Members
  • 7 posts

Posted 28 January 2007 - 11:33 PM

QUOTE (Boki (Berg) @ Jan 28 2007, 12:59 PM) <{POST_SNAPBACK}>
Hello,

It seems that I have add it after I release it. I will re-upload it again now.

regards


I grabbed the new .exe but I still only have date (no time displayed) in the nxDateColumn. Is there some flag to enable to allow time selection?

#10 Vu Quang Thang

Vu Quang Thang
  • Members
  • 91 posts

Posted 29 January 2007 - 04:15 AM

QUOTE (Boki (Berg) @ Jan 29 2007, 12:12 AM) <{POST_SNAPBACK}>
Hello,

I have already upload files with DateTime support in TNxDateColumn.

I will speed now developement on NxTimeColumn (and NxTimeEdit).

regards


Hello,

Another idea is we just need one NxDateTimeColumn and let user decide which data will be displayed.

Regards

#11 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 29 January 2007 - 03:14 PM

Hi,

QUOTE (Sayxanath @ Jan 29 2007, 04:15 AM) <{POST_SNAPBACK}>
Another idea is we just need one NxDateTimeColumn and let user decide which data will be displayed.


Not such a bad idea! It's seems just a matter of a datetimeformat property (string like the formatdate stuff) and link the editing to various the format parts (if it's for instance 'dd' you just call incday with +/- 1 and update the field).
G.W. van der Vegt

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 29 January 2007 - 05:41 PM

Hello Konfoo,

Do you have try next code:

Add one TNxDateColumn and add next code after ButtonClick:

CODE
  NextGrid1.AddRow();
  NextGrid1.Cell[0,0].AsDateTime := Now();


You may control appearance with FormatMask property very easy.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#13 Vu Quang Thang

Vu Quang Thang
  • Members
  • 91 posts

Posted 30 January 2007 - 04:41 PM

QUOTE (wvd_vegt @ Jan 29 2007, 09:14 PM) <{POST_SNAPBACK}>
Hi,
Not such a bad idea! It's seems just a matter of a datetimeformat property (string like the formatdate stuff) and link the editing to various the format parts (if it's for instance 'dd' you just call incday with +/- 1 and update the field).


But if there is one DateTime column, may be it makes confuse about sorting. The data will be sorted by the real datetime data or by the time if the column displays the time only.

#14 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 30 January 2007 - 04:45 PM

Hi,

QUOTE (Sayxanath @ Jan 30 2007, 04:41 PM) <{POST_SNAPBACK}>
But if there is one DateTime column, may be it makes confuse about sorting. The data will be sorted by the real datetime data or by the time if the column displays the time only.


I would prefer sorting to be based on DateTime unless i use the OnCompare Event.

Strange Display Format = Do sorting yourselves.
G.W. van der Vegt

#15 Vu Quang Thang

Vu Quang Thang
  • Members
  • 91 posts

Posted 30 January 2007 - 04:49 PM

QUOTE (wvd_vegt @ Jan 30 2007, 10:45 PM) <{POST_SNAPBACK}>
Hi,
I would prefer sorting to be based on DateTime unless i use the OnCompare Event.


Hello,

I agree with you on this.

Regards

#16 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 31 January 2007 - 10:52 AM

in nextdbgrid, footer is now automatically calculated once i call calculatefooter;

i think its time, that sorting will be automatic too
(also for nextdbgrid)

#17 konfoo

konfoo
  • Members
  • 7 posts

Posted 02 February 2007 - 08:22 AM

QUOTE (Boki (Berg) @ Jan 29 2007, 08:41 AM) <{POST_SNAPBACK}>
Do you have try next code:

Add one TNxDateColumn and add next code after ButtonClick:

CODE
  NextGrid1.AddRow();
  NextGrid1.Cell[0,0].AsDateTime := Now();


You may control appearance with FormatMask property very easy.


Thanks, works like a charm.

Regards
Kon

#18 konfoo

konfoo
  • Members
  • 7 posts

Posted 02 February 2007 - 10:05 AM

I have found what I think is a bug with the datetime column when using the datepicker and using asdatetime() with hh:mm:ss encoded - the datepicker doesn't jump to and hilight the correct date.

Edit:

Changed this in NxEdit to fix date hilighting:

function TNxDatePicker.GetAsDateTime: TDateTime;
begin
if (Text = '') or (Text = '0') then Result := Today
else Result := encodedate(yearof(StrToDateTime(Text)),monthof(StrToDateTime(Text)),dayof(StrToD
ateTime(Text)));
end;

#19 Xillion

Xillion
  • Members
  • 41 posts
  • Gender:Male
  • Location:Netherlands & Belgium

Posted 14 May 2007 - 06:17 PM

Hello,

I am working with the NxDateColumn at the moment, but an NxTimeColumn would be very usefull to me. Therefore my first question: are there any updates to when the NxTimeColumn would be ready?

When looking for a way to display time only in a NxDateColumn I stumbled upon this interesting thread. I read this remark from Boki:
QUOTE (Boki (Berg) @ Jan 29 2007, 06:41 PM) <{POST_SNAPBACK}>
You may control appearance with FormatMask property very easy.

regards


So I figured since the TNxDateColumn now is "DateTime compatible" I could use the FormatMask 'HH:mm' to display only the time part right? Well... Wrong actually. It does display the time, and ommits the date part. However, when displaying data the time separator was shown as a random character. (E.g. 12#23 or 12}23 in stead of 12:23)
Next step: diving into the sources. After some time I found the following method:

CODE
function TNxDateColumn.GetDisplayText(Value: WideString): WideString;
{$IFNDEF DELPHI6}
var
  FormatSettings: TFormatSettings;
{$ENDIF}
begin
    if FormatMask <> ''    then
  begin
    {$IFNDEF DELPHI6}
    FormatSettings.ShortDateFormat := FormatMask;
    FormatSettings.DateSeparator := DateSeparator;
    Result := DateTimeToStr(StrToDateTime(Value), FormatSettings) + TextAfter;
    {$ELSE}
    Result := DateTimeToStr(StrToDateTime(Value)) + TextAfter;
    {$ENDIF}
  end else Result := Value + TextAfter;
end;

The intire FormatMask is assigned to only the SortDateFormat. Since the FormatSettings doesn't get initialized fully the FormatSettings.TimeSeparator can have any random value. Even worse: a full FormatMask (E.g. yyyy-mm-dd hh:nn:ss) would serve little use? When I leave FormatMask empty it does display both the Date and Time part.
I can't set a TNxDateColumn.TimeSeparator property or something, nor does the FormatMask has any influence on the time-related members of FormatSettings. So is my assumption that FormatMask doesn't influence the time part of a TDateTime correct? And if so: is this issue already beƫing adressed? I could fix this as I see fit in the code, but I prefer to leave the code as it is to simplify future updating ;)

Thanks in advance for any answers biggrin.gif

Regards,

Stijn.
Xillion ICT Solutions - www.xillion.nl

aut viam inveniam aut faciam

#20 Xillion

Xillion
  • Members
  • 41 posts
  • Gender:Male
  • Location:Netherlands & Belgium

Posted 14 May 2007 - 06:25 PM

Oh and I forgot to mention:

I'm using NextGrid, NextDBGrid version 3.9.8b. It was released in the users area the 3 of may I think.
Xillion ICT Solutions - www.xillion.nl

aut viam inveniam aut faciam




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users