DatePicker

HMG en Español

Moderator: Rathinagiri

Agustin
Posts: 79
Joined: Sat Feb 16, 2013 10:50 pm
Location: Miranda de Ebro / España

DatePicker

Post by Agustin »

Es posible presentar un control DatePicker vacio, sin ninguna fecha hasta que la introduzca el operador ?

saludos
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: DatePicker

Post by Pablo César »

Creo que esto no sea posible, ya que DatePicker utiliza um campo FECHA. Talvez conseguirias si al invés de utilizar directamente un DatePicker, pases a utilizar um TextBox com campo caracter, hacerle un funcion donde llame un DatePicker y luego lo transforme em STRING.

Este "problema" no es solo en HMG, en várias lenguajes de programacion tienen esta misma característica.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Agustin
Posts: 79
Joined: Sat Feb 16, 2013 10:50 pm
Location: Miranda de Ebro / España

Re: DatePicker

Post by Agustin »

Lo imaginaba.

Gracias Pablo
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: DatePicker

Post by srvet_claudio »

Agustin wrote:Es posible presentar un control DatePicker vacio, sin ninguna fecha hasta que la introduzca el operador ?

saludos
DatePicker y TimePicker son controles nativos de Windows que siempre tienen que tener una fecha y una hora válida.

PD: El control TimePicker estará disponible en la nueva versión de HMG.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Mario Mansilla
Posts: 270
Joined: Wed Aug 13, 2008 2:35 pm
Location: Córdoba - Argentina

Re: DatePicker

Post by Mario Mansilla »

Hola Claudio :
Que buena noticia , espero que Roberto y Rathi lo puedan incorporar al ide como un nuevo control .
Saludos .
Mario Mansilla
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: DatePicker

Post by Leopoldo Blancas »

Excelente Claudio!!!... Como siempre.

Saludos
Polo
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: DatePicker

Post by CalScot »

I wondered whether it would be possible to enter a date of 00/00/00 (not blank, but it might work as a compromise?), so I used CTOD("00/00/00") as the value for a DatePicker field.

It didn't like 00 as either the month or the day, so it didn't work, but maybe you could try using
01/01/00 (or 01/01/2000) as a "blank" date.

On a lighter note: Playing around with DatePicker, I discovered that

The earliest date it accepts is 14-Sep-1752
& the latest date it accepts is 31-Dec-9999

I can understand 12/31/9999, but 09/14/1752? Somebody must have had a reason!!
CalScot
User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
Location: Araruama-RJ, Brazil

Re: DatePicker

Post by Amarante »

CalScot wrote: On a lighter note: Playing around with DatePicker, I discovered that

The earliest date it accepts is 14-Sep-1752
& the latest date it accepts is 31-Dec-9999

I can understand 12/31/9999, but 09/14/1752? Somebody must have had a reason!!
CalScot
Historical Events for 14th September 1752:
US & England adopts Gregorian calender (no Sept 3-Sept 13th)
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: DatePicker

Post by CalScot »

Thank you, Amarante. That explains it!

Not only do we get amazing technical and programming support here, but we get history lessons, too! I love it!

Thanks again.
CalScot
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: DatePicker

Post by Carlos Britos »

Hi
In HMG Extended exist something like this

Code: Select all

HB_FUNC( SETDATEPICKNULL )
{
   SendMessage( ( HWND ) hb_parnl( 1 ), DTM_SETSYSTEMTIME, GDT_NONE, ( LPARAM ) 0 );
}


      IF Empty ( Value )
         SetDatePickNull ( ControlHandle )
      ELSE
         SetDatePick( ControlHandle, Year( value ), Month( value ), Day( value ) )
      ENDIF
Maybe someone can test it.
Regards/Saludos, Carlos (bcd12a)
Post Reply