It would help considerably if you would state what your problem is, and then we can offer a solution.
So far, you guessed at a wrong solution, and now are complaining that it doesn't solve your problem. Well, that's because the solution you chose isn't meant to solve your problem. It solves a different one.
Now, if we knew what your problem IS, we could help you.
Apparently, it has something to do with "the problem of multiple elements with datepicker using class instead of element ID".
You've told us there's some problem. Now, just what is that problem?
Can you make a jsFiddle that demonstrates it?
If you just want to change the format accepted and displayed, that's what dateFormat is for. Not altFormat.