You can not have functions created inside an array. They will never be accessible.
Also, you are pulling out data from the $events array, but try to alter it in the array. No go!
First, you should not use shortcodes. = is print or better echo…
To print or display something in an array, you might do this:
echo $events['e][other-dimensions-of-array];
This displays (prints) the value inside of the array.
For a function, you might have something like:
function some-function-name($formattime) {
some function code…
}
You would NOT put a function inside of an array. I will guess you are doing this for a class and do not have any understanding on functions. I am guessing someone said to do it that way. So, to use your own function, it would be declared before you ever use it. Like I showed before. Then, you would use that function inside your echo line. Do you understand that?