Frontend: Fix Photo.localMonthString()

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-11-02 00:30:26 +01:00
parent f35313b436
commit b540e4ec03
4 changed files with 21700 additions and 3311 deletions

View file

@ -80,13 +80,13 @@ clean-local-config:
dep-list:
go list -u -m -json all | go-mod-outdated -direct
dep-js:
(cd frontend && npm install --silent && npm audit fix)
(cd frontend && npm install --silent --legacy-peer-deps && npm audit fix)
dep-go:
go build -v ./...
dep-upgrade:
go get -u -t ./...
dep-upgrade-js:
(cd frontend && npm --depth 3 update)
(cd frontend && npm --depth 3 update --legacy-peer-deps)
dep-tensorflow:
scripts/download-nasnet.sh
scripts/download-nsfw.sh

24963
frontend/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -141,7 +141,7 @@ export class Photo extends RestModel {
localMonthString() {
if (!this.TakenAtLocal) {
return new Date().getMonth().toString().padStart(2, "0");
return (new Date().getMonth() + 1).toString().padStart(2, "0");
}
if (!this.Month || this.Month <= 0) {

View file

@ -136,7 +136,7 @@ describe("model/photo", () => {
const values = {ID: 5, Title: "Crazy Cat", TakenAt: "2012-07-08T14:45:39Z", TimeZone: "UTC"};
const photo = new Photo(values);
const result = photo.localMonthString();
assert.equal(result, "09");
assert.equal(result, (new Date().getMonth() + 1).toString().padStart(2, "0"));
const values2 = {ID: 5, Title: "Crazy Cat", TakenAtLocal: "2012-07-08T14:45:39Z", TakenAt: "2012-07-08T14:45:39Z", TimeZone: "UTC", Month: 8};
const photo2 = new Photo(values2);
const result2 = photo2.localMonthString();