transform_filter_property(<<"date">>, FilterProperty)->
["DATE(", FilterProperty, ")"];
transform_filter_property(_, FilterProperty) ->
FilterProperty.
transform_filter_value(<<"date">>, <<M:2/binary, _:8, D:2/binary, _:8, Y:4/binary>>) ->
[Y, "-", M, "-", D, "-"];
transform_filter_value(_, FilterValue) ->
FilterValue.
function transform_filter_property(type, FilterProperty) {
if (typeof type == 'binary' && type == "date") {
return ["DATE(", FilterProperty, ")"];
} else {
return FilterProperty;
}
function transform_filter_value(type, FilterValue) {
if (typeof type == 'binary' && type == "date" &&
typeof FilterValue == 'binary' && strlen(FilterValue) == 10) {
return [substr(FilterValue, 6, 4), "-",
substr(FilterValue, 3, 2), "-",
substr(FilterValue, 0, 2), "-"];
} else {
return FilterValue;
}
}