MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / DateTimeIntellektFormat

Function DateTimeIntellektFormat

sourcecommon/utils.cpp:1593–1637  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1591}
1592//---------------------------------------------------------------------------
1593String DateTimeIntellektFormat(TDateTime dt, String _TimeFormat)
1594{
1595 TDateTime t = Now();
1596 unsigned short c_year, c_month, c_day;
1597 t.DecodeDate(&c_year, &c_month, &c_day);
1598 unsigned short year, month, day;
1599 dt.DecodeDate(&year, &month, &day);
1600 // ��� ������� ?
1601 if( (int)t == (int)dt )
1602 {
1603 // ��: �����
1604 // ���������� ��������� ��������� ���� �������
1605 //return dt.TimeString();
1606 return dt.FormatString(_TimeFormat);
1607 }
1608 // ��� � �������� �������� ���� ?
1609 else if( c_year == year )
1610 {
1611 // ��: ����� ����� �����
1612 return dt.FormatString("d mmm " + _TimeFormat);
1613 }
1614 /*
1615 // ��� � �������� �������� ������ ?
1616 else if( (int)t - (int)dt < day )
1617 {
1618 // �� - �����, ����� + �����
1619 return dt.FormatString("d mmm " + _TimeFormat);
1620 }
1621 */
1622 /*
1623 // ��� � �������� ������ ?
1624 else if( (int)t - (int)dt < 7 )
1625 {
1626 // �� - �������� ��� ������ + �����
1627 return GetDayOfWeekNameLong(DayOfWeek(dt)) + " " + dt.FormatString(_TimeFormat);
1628 }
1629 */
1630 else
1631 {
1632 // ���������� ��������� ��������� ��� �������������� ���� �������
1633 //return dt.FormatString(FormatSettings.ShortDateFormat + " " + _TimeFormat);
1634 // ����� ����� ��� �����
1635 return dt.FormatString("d mmm yyyy " + _TimeFormat);
1636 }
1637}
1638//---------------------------------------------------------------------------
1639bool setClipboard(AnsiString & lines){
1640 HGLOBAL handle;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected