Problem with calendar day positioning

Hello guys and happy new year everyone,
I write a code for calendar and now I’m at the point where I must make my first day of a month be situated at the right place. I mean if today is Jan 4th then it should be below the Wednesday column. After a lot of tries I still can’t figure it out.
Below is the link of calendar:
And here is the github page, where you can find the code:
Please if anybody can help me with something, I would appreciate any help,
Thanks in advance.

Try to find some algorithm to determine first day of month and then change your createDays() method.