First, lets get some definitions down so we can talk clearly about what we are trying to figure out.
Pay Period: The (usually 2 week) period of time in which all worked hours are calculated and a pay check is issued according to the hours worked.
Pay Day: The day on which you receive your pay check.
Suppose I am getting paid on 26th Jan, does that mean January started or ended on the 26th?
The answer to this could be started, ended, or neither, depending on pay schemes. Pay Days usually come a week or two AFTER the pay period ends, rarely have I seen people getting paid immediately following the pay period they just finished. This is to allow time for accountants to apply taxes and calculate any overtime or extra pay.
If you are on salary, and your pay check is the same every month no matter what, you may get paid right away. For that matter, even if your pay period was two weeks and there was two weeks of lag until your pay-check, it may appear that you are paid immediately following the pay-period, when in the eyes of accountants, you are being paid for two weeks ago.
As for figuring this out, most pay stubs should say which period they are pertaining to so that employees can double check that the check is correct.
Right now I have given the user the option to change the starting day for every month...
I think there needs to be more options than this. First, select between a biweekly, paid on friday scheme with a two week lag for pay-check (Very common). Here a user only inputs the days on which the week starts and you're done.
The second would be a fixed start date (such as every 1st and 16th). For this you would use the information from the pay stubs to determine when those start dates were. Generally, regardless of the number of days in a month (and thus the number of days in the pay period) pay days or calendar months begin on the same day. For example, say pay periods start the 1st and 16th. This is very common. Your pay period then ends on the 15th, and last day of the month (be that 28, 30, 31)
If a user could input the type, and then the appropriate start dates, you have the app do the rest.
I thought there would be some concrete rules for that, but it seems everyone is making things up as they go along.
There aren't.
There are many different pay schemes out there, varying by company policy, common practice, national law, and international employment standards. What we come up with here or what you build into your app may not be applicable to everyone.
Because I'm invested in this now, I'm gonna answer your original question the best I can.
If you have pay day on Jan 26th, assuming a 7-day lag from the end of the pay period and a roughly 15 day pay period, your periods end on the 19th, and therefore start on the 20th and 6th (15 days later).
Now assume your pay day is Jan 26th and you are on a biweekly, paid friday scheme with you being paid the friday following the pay period, and weeks end on Sunday. Your current pay period started on the 21st, and your previous pay period ended on the 20th. Your next pay day will be the 8th of February.
Someone please correct me if I messed this up, it's late haha.