mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
Snippet: add ww
as the week number with leading zero
This commit is contained in:
parent
c03884c429
commit
0cf0da06f8
@ -12,6 +12,7 @@
|
|||||||
#include <core/configmgr.h>
|
#include <core/configmgr.h>
|
||||||
#include <buffer/buffer.h>
|
#include <buffer/buffer.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
#include <utils/utils.h>
|
||||||
#include <utils/pathutils.h>
|
#include <utils/pathutils.h>
|
||||||
#include <vtextedit/vtextedit.h>
|
#include <vtextedit/vtextedit.h>
|
||||||
#include <vtextedit/texteditutils.h>
|
#include <vtextedit/texteditutils.h>
|
||||||
@ -349,6 +350,12 @@ QVector<QSharedPointer<Snippet>> SnippetMgr::loadBuiltInSnippets() const
|
|||||||
[](const QString &) {
|
[](const QString &) {
|
||||||
return QString::number(QDate::currentDate().weekNumber());
|
return QString::number(QDate::currentDate().weekNumber());
|
||||||
});
|
});
|
||||||
|
addDynamicSnippet(snippets,
|
||||||
|
"ww",
|
||||||
|
tr("the week number with a leading zero (`01` to `53`)"),
|
||||||
|
[](const QString &) {
|
||||||
|
return Utils::intToString(QDate::currentDate().weekNumber(), 2);
|
||||||
|
});
|
||||||
addDynamicSnippet(snippets,
|
addDynamicSnippet(snippets,
|
||||||
"H",
|
"H",
|
||||||
tr("the hour without a leading zero (`0` to `23` even with AM/PM display)"),
|
tr("the hour without a leading zero (`0` to `23` even with AM/PM display)"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user