Functional Lagrange formalism for time-non-local Lagrangians