Assign the variable at declaration time if it's known at declaration time. Else it's initialized with NULL and you need another statement to assign it. A small waste of code and performance.

    DO
    $$
    DECLARE
       dateval date[] := '{2015-4-12, 2015-4-19}';
    BEGIN
       -- do something
    END
    $$;

You just need the right syntax for *either* an **array literal** *or* an **[ARRAY constructor][1]**.

The string literal above needs no explicit cast, since the type is defined in the assignment implicitly.

Related:

- https://dba.stackexchange.com/questions/114549/array-of-strings-when-updating-a-field/114562#114562

  [1]: https://www.postgresql.org/docs/current/static/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS