--- /dev/null
+// TortoiseGit - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2003-2008 - TortoiseGit\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#include "StdAfx.h"\r
+#include "resource.h"\r
+//#include "TortoiseProc.h"\r
+//#include "PathUtils.h"\r
+#include "TortoiseGitBlameAppUtils.h"\r
+//#include "GitProperties.h"\r
+//#include "StringUtils.h"\r
+//#include "MessageBox.h"\r
+#include "Registry.h"\r
+//#include "TGitPath.h"\r
+//include "Git.h"\r
+//#include "RepositoryBrowser.h"\r
+//#include "BrowseFolder.h"\r
+//#include "UnicodeUtils.h"\r
+//#include "ExportDlg.h"\r
+//#include "ProgressDlg.h"\r
+//#include "GitAdminDir.h"\r
+//#include "ProgressDlg.h"\r
+//#include "BrowseFolder.h"\r
+//#include "DirFileEnum.h"\r
+//#include "MessageBox.h"\r
+//#include "GitStatus.h"\r
+//#include "CreateBranchTagDlg.h"\r
+//#include "GitSwitchDlg.h"\r
+//#include "ResetDlg.h"\r
+//#include "commctrl.h"\r
+\r
+CAppUtils::CAppUtils(void)\r
+{\r
+}\r
+\r
+CAppUtils::~CAppUtils(void)\r
+{\r
+}\r
+\r
+/**\r
+ * FUNCTION : FormatDateAndTime\r
+ * DESCRIPTION : Generates a displayable string from a CTime object in\r
+ * system short or long format dependant on setting of option\r
+ * as DATE_SHORTDATE or DATE_LONGDATE\r
+ * If HKCU\Software\TortoiseGit\UseSystemLocaleForDates is 0 then use fixed format\r
+ * rather than locale\r
+ * RETURN : CString containing date/time\r
+ */\r
+CString CAppUtils::FormatDateAndTime( const CTime& cTime, DWORD option, bool bIncludeTime /*=true*/ )\r
+{\r
+ CString datetime;\r
+ // should we use the locale settings for formatting the date/time?\r
+ if (CRegDWORD(_T("Software\\TortoiseGit\\UseSystemLocaleForDates"), TRUE))\r
+ {\r
+ // yes\r
+ SYSTEMTIME sysTime;\r
+ cTime.GetAsSystemTime( sysTime );\r
+ \r
+ TCHAR buf[100];\r
+ \r
+ GetDateFormat(LOCALE_USER_DEFAULT, option, &sysTime, NULL, buf, \r
+ sizeof(buf)/sizeof(TCHAR)-1);\r
+ datetime = buf;\r
+ if ( bIncludeTime )\r
+ {\r
+ datetime += _T(" ");\r
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &sysTime, NULL, buf, sizeof(buf)/sizeof(TCHAR)-1);\r
+ datetime += buf;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ // no, so fixed format\r
+ if ( bIncludeTime )\r
+ {\r
+ datetime = cTime.Format(_T("%Y-%m-%d %H:%M:%S"));\r
+ }\r
+ else\r
+ {\r
+ datetime = cTime.Format(_T("%Y-%m-%d"));\r
+ }\r
+ }\r
+ return datetime;\r
+}\r
--- /dev/null
+// TortoiseSVN - a Windows shell extension for easy version control\r
+\r
+// Copyright (C) 2003-2008 - TortoiseSVN\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+//\r
+#pragma once\r
+/**\r
+ * \ingroup TortoiseGitBlame\r
+ * An utility class with static functions.\r
+ */\r
+class CAppUtils\r
+{\r
+public:\r
+ CAppUtils(void);\r
+ ~CAppUtils(void);\r
+\r
+ /**\r
+ * FUNCTION : FormatDateAndTime\r
+ * DESCRIPTION : Generates a displayable string from a CTime object in\r
+ * system short or long format dependant on setting of option\r
+ * as DATE_SHORTDATE or DATE_LONGDATE. bIncludeTime (optional) includes time.\r
+ * RETURN : CString containing date/time\r
+ */\r
+ static CString FormatDateAndTime( const CTime& cTime, DWORD option, bool bIncludeTime=true );\r
+\r
+ \r
+private:\r
+};\r