POSTGRES declaring variable containing date array in functions
You can use ARRAY keyword:

create table tbl (dateval date[]);
insert into tbl values(array ['20180101','20180102'::date]);


Or in a block of code:

do $$
declare 
    dateval date[];
begin
    dateval := array ['20180101','20180102'::date];
end;
$$;


Or cast the expression as an array of dates.

do $$
declare 
    dateval date[];
begin
    dateval := '{2015-4-12, 2015-4-19}'::date[];
end;
$$;


db&lt;>fiddle here