Merge pull request #1329 from Maxime-J/mysql-fix

follow-up - reverted getDateQuery logic
This commit is contained in:
Mike Cao 2022-07-22 14:18:18 -07:00 committed by GitHub
commit 6f92677f10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -22,7 +22,7 @@ npm install -g yarn
### Get the source code and install packages
```
git clone https://github.com/mikecao/umami.git
git clone https://github.com/umami-software/umami.git
cd umami
yarn install
```

View File

@ -3,7 +3,7 @@
"description": "Umami is a simple, fast, website analytics alternative to Google Analytics.",
"keywords": ["analytics", "charts", "statistics", "web-analytics"],
"website": "https://umami.is",
"repository": "https://github.com/mikecao/umami",
"repository": "https://github.com/umami-software/umami",
"addons": ["heroku-postgresql"],
"env": {
"HASH_SALT": {

View File

@ -2,7 +2,7 @@
version: '3'
services:
umami:
image: ghcr.io/mikecao/umami:postgresql-latest
image: ghcr.io/umami-software/umami:postgresql-latest
ports:
- "3000:3000"
environment:

View File

@ -21,7 +21,7 @@ export function getDateQuery(field, unit, timezone) {
if (timezone) {
return `to_char(date_trunc('${unit}', ${field} at time zone '${timezone}'), '${POSTGRESQL_DATE_FORMATS[unit]}')`;
}
return `date_trunc('${unit}', ${field})`;
return `to_char(date_trunc('${unit}', ${field}), '${POSTGRESQL_DATE_FORMATS[unit]}')`;
}
if (db === MYSQL) {
@ -31,7 +31,7 @@ export function getDateQuery(field, unit, timezone) {
return `date_format(convert_tz(${field},'+00:00','${tz}'), '${MYSQL_DATE_FORMATS[unit]}')`;
}
return `${field}`;
return `date_format(${field}, '${MYSQL_DATE_FORMATS[unit]}')`;
}
}

View File

@ -1,6 +1,6 @@
{
"name": "umami",
"version": "1.34.0",
"version": "1.35.0",
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
"author": "Mike Cao <mike@mikecao.com>",
"license": "MIT",