Jump to content


Photo

NextInspector - TNXDateItem


  • Please log in to reply
12 replies to this topic

#1 Orpheus87

Orpheus87
  • Members
  • 11 posts
  • Gender:Male

Posted 30 September 2015 - 12:08 PM

Dear Mr Boki,

 

Thank you for your amazing component.

I caught some error when I use TNXDateItem on NextInspector.

TNXDateItem didn't read properties "FormatMask" but it reads datetime setting base on OS.

I already try use your example from the website and caught some error. (please see attachment)

Any idea?

 

Thank you.

 

Attached File  01-BOKI.jpg   86.81KB   0 downloads

 

setting on my OS

 

Attached File  02-BOKI.jpg   36.88KB   0 downloads



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 30 September 2015 - 06:31 PM

Hi,

 

This is the code I use:

 

function TNxDateItem.GetAsString: WideString;
begin
  if FValue = 0 then
  begin
    Result := '';
  end else
    if FFormatMask <> ''
      then Result := FormatDateTime(FFormatMask, FValue)
      else Result := DateToStr(FValue);
end;

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.

#3 Orpheus87

Orpheus87
  • Members
  • 11 posts
  • Gender:Male

Posted 01 October 2015 - 04:54 AM

Dear Mr Boki,

 

Thank you for your answer.

But this is I got when my apps caught some error:

 

Raise some errors:

Attached File  03-BOKI.jpg   33.46KB   0 downloads

 

On SourceCode:

Attached File  04-BOKI.jpg   36.1KB   0 downloads

 

Please kindly tell me what can I do for this issue?

Thank you

 

Regards,

 

Orps



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 October 2015 - 11:03 AM

Hi,

Can you tell me does this error shows after you select data inside picker?
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.

#5 Orpheus87

Orpheus87
  • Members
  • 11 posts
  • Gender:Male

Posted 02 October 2015 - 09:25 AM

Dear Mr Boki,

 

Yes, this error does show after I select data inside picker

Can you tell me how to solve this?

 

Thank you..

 

Regards,

 

Orps



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 02 October 2015 - 10:59 AM

Hi Orps,

Understand now. Did you maybe try to set ShortDateFormat and LongDateFormat for your app specifically?
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 Orpheus87

Orpheus87
  • Members
  • 11 posts
  • Gender:Male

Posted 05 October 2015 - 04:28 AM

Dear Mr Boki,

 

I just set format mask for this component and I didnt set ShortDateFormat or LongDateFormat for this app specify, although I set shortDateFormat only for my OS (windows).

I set format mask for this component: dd-mmm-yyyy

Did I do something wrong?

 

Attached File  01-BOKI.jpg   50.38KB   0 downloads

 

Fyi, the following are the results of my experiment:

  • everytime I change it values, it becomes to today and get same error
  • I tried to clear formatMask I used, but still I get same error
  • I already use same component in read-only mode and its fine

Attached File  02-BOKI.jpg   92.46KB   0 downloads

 

Please your advice. Thank you.

 

Regards,

 

Orps



#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 06 October 2015 - 07:11 PM

Hi Orpheus,

 

I will send you results tomorrow. Please sorry for delay, worked on D10 Seattle packages all day.


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 Orpheus87

Orpheus87
  • Members
  • 11 posts
  • Gender:Male

Posted 07 October 2015 - 09:31 AM

Dear Mr Boki,

 

Not a problem, sir. :D

Very appreciate

 

Regards,

 

Orp



#10 Orpheus87

Orpheus87
  • Members
  • 11 posts
  • Gender:Male

Posted 15 October 2015 - 09:20 AM

Dear Mr Boki,

 

Is there any information about my issue sire?

 

Regards,

 

Orps



#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 October 2015 - 04:29 PM

Hi Orp,

 

Sorry for delay. I have problems understanding where the bug is actually. It seems that ScanDate delphi function (in System.SysUtils) doesn't allow alphabetic (Oct, Now, Dec) characters for months. For example this work:

 

// inside OnCreate
 NxDateItem1.FormatMask := 'dd/mm/yyyy';
  FormatSettings.DateSeparator := '-';
 
  FormatSettings.ShortDateFormat := NxDateItem1.FormatMask;

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.

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 October 2015 - 04:30 PM

In Delphi function there is a line that expect number after separator (?):

 

function ScanDate(const S: string; var Pos: Integer; var Date: TDateTime;
  const AFormatSettings: TFormatSettings): Boolean; overload;
...
if not (ScanNumber(S, Pos, N1, L1) and ScanChar(S, Pos, AFormatSettings.DateSeparator) and
    ScanNumber(S, Pos, N2, L2)) then Exit;

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 Orpheus87

Orpheus87
  • Members
  • 11 posts
  • Gender:Male

Posted 19 October 2015 - 09:51 AM

Dear Mr Boki,

 

But why, component TNXDatePicker just fine but TNXDateItem on TNextInspector had trouble?

Please see attachment

 

Regards,

 

Orps

 

 

Attached File  Boki.zip   317.72KB   0 downloads






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users