Use GUI locale date formats on GUI and dialogs
This commit is contained in:
@@ -57,7 +57,7 @@ class VersionInfoWidget(QWidget):
|
||||
# Labels
|
||||
self._lblInfo = QLabel("{0} {1} \u2013 {2} {3} \u2013 {4}".format(
|
||||
self.tr("Version"), formatVersion(__version__),
|
||||
self.tr("Released on"), datetime.strptime(__date__, "%Y-%m-%d").strftime("%x"),
|
||||
self.tr("Released on"), CONFIG.localDate(datetime.strptime(__date__, "%Y-%m-%d")),
|
||||
"<a href='#notes'>{0}</a>".format(self.tr("Release Notes")),
|
||||
), self)
|
||||
self._lblInfo.linkActivated.connect(self._processLink)
|
||||
|
||||
@@ -457,7 +457,7 @@ class GuiMain(QMainWindow):
|
||||
"'{0}' ({1} {2}), last active on {3}."
|
||||
).format(
|
||||
lockStatus[0], lockStatus[1], lockStatus[2],
|
||||
datetime.fromtimestamp(int(lockStatus[3])).strftime("%x %X")
|
||||
CONFIG.localDateTime(datetime.fromtimestamp(int(lockStatus[3])))
|
||||
)
|
||||
except Exception:
|
||||
lockDetails = ""
|
||||
|
||||
@@ -829,7 +829,7 @@ class _PreviewWidget(QTextBrowser):
|
||||
"""Update the build time and the fuzzy age."""
|
||||
if self._docTime > 0:
|
||||
strBuildTime = "%s (%s)" % (
|
||||
datetime.fromtimestamp(self._docTime).strftime("%x %X"),
|
||||
CONFIG.localDateTime(datetime.fromtimestamp(self._docTime)),
|
||||
fuzzyTime(int(time()) - self._docTime)
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -456,7 +456,7 @@ class _ProjectListModel(QAbstractListModel):
|
||||
opened = self.tr("Last Opened")
|
||||
records = sorted(CONFIG.recentProjects.listEntries(), key=lambda x: x[3], reverse=True)
|
||||
for path, title, count, time in records:
|
||||
when = datetime.fromtimestamp(time).strftime("%x")
|
||||
when = CONFIG.localDate(datetime.fromtimestamp(time))
|
||||
data.append((title, path, f"{opened}: {when}, {words}: {formatInt(count)}"))
|
||||
self._data = data
|
||||
return
|
||||
|
||||
@@ -75,8 +75,8 @@ def testToolWelcome_Open(qtbot: QtBot, monkeypatch, nwGUI, fncPath):
|
||||
|
||||
CONFIG.recentProjects.update("/stuff/project_one", "Project One", 12345, 1690000000)
|
||||
CONFIG.recentProjects.update("/stuff/project_two", "Project Two", 54321, 1700000000)
|
||||
dateOne = datetime.fromtimestamp(1700000000).strftime("%x")
|
||||
dateTwo = datetime.fromtimestamp(1690000000).strftime("%x")
|
||||
dateOne = CONFIG.localDate(datetime.fromtimestamp(1700000000))
|
||||
dateTwo = CONFIG.localDate(datetime.fromtimestamp(1690000000))
|
||||
|
||||
welcome = GuiWelcome(nwGUI)
|
||||
with qtbot.waitExposed(welcome):
|
||||
|
||||
Reference in New Issue
Block a user