Código de Lazarus - Calendario para tus aplicaciones

<<>>
sin imagen de perfil
Val: 10
Ha aumentado su posición en 2 puestos en Lazarus (en relación al último mes)
Gráfica de Lazarus

Calendario para tus aplicacionesgráfica de visualizaciones


Lazarus

Publicado el 2 de Julio del 2021 por Eladio
3.919 visualizaciones desde el 2 de Julio del 2021
Hola amigos, aqui os dejo una función que podeis utilizar para integrar en vuestros programas. Se trata de un calendario que da los siguientes datos:

* nombre del mes
* dia del mes
* Dia de la semana
* Numero de semana dentro del año
* Dias que han transcurrido del año
* Dias que faltan para que termine el año.

La presentación de los datos queda a la imaginación y creatividad de cada uno.
Espero que os guste y os sirva.

1.0

Publicado el 2 de Julio del 2021gráfica de visualizaciones de la versión: 1.0
3.920 visualizaciones desde el 2 de Julio del 2021
estrellaestrellaestrellaestrellaestrella
estrellaestrellaestrellaestrella
estrellaestrellaestrella
estrellaestrella
estrella

Imagen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  StdCtrls, Buttons, Grids, Windows;
......
 
Function Calendario: String;
var
   frstDay,toDay : TDateTime;
   week, BS: Integer;
   WK, DD, MM, AA, S_F: String;
   Yr, Mnth, Day: Word;
   stSystemTime : TSystemTime;
Begin
   Result := '';
   WK := IntToStr(DayOfWeek(Now)); MM := FormatDateTime('mm', Now);
   DecodeDate(Date, Yr, Mnth, Day);
   if IsLeapYear(Yr) then BS := 366 Else BS := 365;
   If WK = '1' Then WK := 'Domingo';
   If WK = '2' Then WK := 'Lunes';
   If WK = '3' Then WK := 'Martes';
   If WK = '4' Then WK := 'Miercoles';
   If WK = '5' Then WK := 'Jueves';
   If WK = '6' Then WK := 'viernes';
   If WK = '7' Then WK := 'sabado';
   If MM = '01' Then MM := 'enero';
   If MM = '02' Then MM := 'febrero';
   If MM = '03' Then MM := 'marzo';
   If MM = '04' Then MM := 'abril';
   If MM = '05' Then MM := 'mayo';
   If MM = '06' Then MM := 'junio';
   If MM = '07' Then MM := 'julio';
   If MM = '08' Then MM := 'agosto';
   If MM = '09' Then MM := 'septiembre';
   If MM = '10' Then MM := 'octubre';
   If MM = '11' Then MM := 'noviembre';
   If MM = '12' Then MM := 'diciembre';
   Windows.GetLocalTime( stSystemTime );
   S_F := DateTimeToStr( SystemTimeToDateTime( stSystemTime ) );
   S_F := Copy(S_F, 3, 1);
   Result := Uppercase(MM) + '|';
   Result := Result + FormatDateTime('dd', Now) + '|';
   Result := Result + WK + '|';
   frstDay := StrToDate('01' + S_F + '01' + S_F + FormatDateTime('yy', Now));
   toDay := StrToDate(FormatDatetime('dd', Now) + S_F + FormatDatetime('mm', Now) + S_F + FormatDatetime('yy', Now));
   week := Trunc((toDay - frstDay) / 7) + 1;
   Result := Result + 'Semana ' + IntToStr(week) + '|';
   Result := Result + 'día ' + IntToStr(Trunc(toDay - frstDay) + 1) + ', faltan ' + IntTostr(BS - Trunc(toDay - frstDay) - 1) + '|';
End;
 
Para llamar a la función:
 
   P := Calendario;
 
Para visualizar los datos:
 
   Label31.Caption := Copy(P, 1, Pos('|', P) - 1);
   P := Copy(P, Pos('|', P) + 1, Length(P) - Pos('|', P));
   Label32.Caption := Copy(P, 1, Pos('|', P) - 1);
   P := Copy(P, Pos('|', P) + 1, Length(P) - Pos('|', P));
   Label33.Caption := Copy(P, 1, Pos('|', P) - 1);
   P := Copy(P, Pos('|', P) + 1, Length(P) - Pos('|', P));
   Label34.Caption := Copy(P, 1, Pos('|', P) - 1);
   P := Copy(P, Pos('|', P) + 1, Length(P) - Pos('|', P));
   Label35.Caption := Copy(P, 1, Pos('|', P) - 1);
   P := Copy(P, Pos('|', P) + 1, Length(P) - Pos('|', P));



Comentarios sobre la versión: 1.0 (0)


No hay comentarios
 

Comentar la versión: 1.0

Nombre
Correo (no se visualiza en la web)
Valoración
Comentarios...
CerrarCerrar
CerrarCerrar
Cerrar

Tienes que ser un usuario registrado para poder insertar imágenes, archivos y/o videos.

Puedes registrarte o validarte desde aquí.

Codigo
Negrita
Subrayado
Tachado
Cursiva
Insertar enlace
Imagen externa
Emoticon
Tabular
Centrar
Titulo
Linea
Disminuir
Aumentar
Vista preliminar
sonreir
dientes
lengua
guiño
enfadado
confundido
llorar
avergonzado
sorprendido
triste
sol
estrella
jarra
camara
taza de cafe
email
beso
bombilla
amor
mal
bien
Es necesario revisar y aceptar las políticas de privacidad

http://lwp-l.com/s7114