1
0
lazarus-tutorials/test_dateform/maintest.pas

46 lines
625 B
ObjectPascal
Raw Permalink Normal View History

2021-10-14 15:21:08 -04:00
unit maintest;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, dateform;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var d: TDateTime = 0;
begin
if GetDate(d) then
ShowMessageFmt(
'The date obtained via GetDate() was %s',
[FormatDateTime('dd/mm/yyyy', d)]
)
else
ShowMessage('The date entry dialog was cancelled or an invalid date was entered');
end;
end.