T+2 days settlement period

Salaam guys
I bought a share in Tesla exactly one month ago which I sold three weeks later after purchasing it. is this allowed due to the t +2 day settlement period (is there a minimum period I have to wait before I could sell the share and is 3 weeks long enough to wait before I sold the share).

Please could someone reply.

Jazakallah