Skip to content
Snippets Groups Projects
Commit 72c6375b authored by Allen Gilliland's avatar Allen Gilliland
Browse files

don't provide an option in the special-type dropdown for timestamp_*...

don't provide an option in the special-type dropdown for timestamp_* conversions if the field base type is not numeric.
parent 09f371a0
Branches
Tags
No related merge requests found
......@@ -4,6 +4,7 @@ import Input from "metabase/components/Input.jsx";
import Select from "metabase/components/Select.jsx";
import * as MetabaseCore from "metabase/lib/core";
import { isNumeric } from "metabase/lib/schema_metadata";
import _ from "underscore";
......@@ -106,6 +107,10 @@ export default class Column extends Component {
let specialTypes = MetabaseCore.field_special_types.slice(0);
specialTypes.push({'id': null, 'name': 'No special type', 'section': 'Other'});
// if we don't have a numeric base-type then prevent the options for unix timestamp conversion (#823)
if (!isNumeric(this.props.field)) {
specialTypes = specialTypes.filter((f) => !(f.id && f.id.startsWith("timestamp_")));
}
return (
<li className="mt1 mb3">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment