mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 09:33:19 +03:00
Fixes couple of Flatpickr related issues (#495)
* Navigates to day when same day is chosen in flatpickr * Ensures that erroneous from and to params are removed when re-navigating * Changelog
This commit is contained in:
parent
df9767dbdc
commit
1174801255
@ -30,6 +30,8 @@ All notable changes to this project will be documented in this file.
|
||||
- Fix URL decoding in query parameters plausible/analytics#416
|
||||
- Fix overly-sticky date in query parameters plausible/analytics/#439
|
||||
- Prevent picking dates before site insertion plausible/analtics#446
|
||||
- Fix overly-sticky from and to in query parameters plausible/analytics#495
|
||||
- Adds support for single-day date selection plausible/analytics#495
|
||||
|
||||
### Security
|
||||
- Do not run the plausible Docker container as root plausible/analytics#362
|
||||
|
@ -223,16 +223,29 @@ class DatePicker extends React.Component {
|
||||
setCustomDate(dates) {
|
||||
if (dates.length === 2) {
|
||||
const [from, to] = dates
|
||||
navigateToQuery(
|
||||
this.props.history,
|
||||
this.props.query,
|
||||
{
|
||||
period: 'custom',
|
||||
date: false,
|
||||
from: formatISO(from),
|
||||
to: formatISO(to),
|
||||
}
|
||||
)
|
||||
if (formatISO(from) === formatISO(to)) {
|
||||
navigateToQuery(
|
||||
this.props.history,
|
||||
this.props.query,
|
||||
{
|
||||
period: 'day',
|
||||
date: formatISO(from),
|
||||
from: false,
|
||||
to: false,
|
||||
}
|
||||
)
|
||||
} else {
|
||||
navigateToQuery(
|
||||
this.props.history,
|
||||
this.props.query,
|
||||
{
|
||||
period: 'custom',
|
||||
date: false,
|
||||
from: formatISO(from),
|
||||
to: formatISO(to),
|
||||
}
|
||||
)
|
||||
}
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ export function parseQuery(querystring, site) {
|
||||
function generateQueryString(data) {
|
||||
const query = new URLSearchParams(window.location.search)
|
||||
query.delete("date");
|
||||
query.delete("from");
|
||||
query.delete("to");
|
||||
Object.keys(data).forEach(key => {
|
||||
if (!data[key]) {
|
||||
query.delete(key)
|
||||
|
Loading…
Reference in New Issue
Block a user