Period came early

My period was 19 days ago my next period is due in 6 days but it just came today i was speaking to my friend and she said my period is irregular & that’s weird it came so early . But I did have sex yesterday so I’m wondering maybe that’s why it came so early ? Has this happened to anyone?