What happens if I buy before my 30 day trial is finished?

Subscriptions, per Apple's policy, are considered new purchases and do not include any remaining time in a trial. ForeFlight subscriptions unlock features not available in the trial, like bulk downloading, so remaining time in your trial is not applied to your new subscription. If you buy a one-year subscription, it will expire 365 days from the day of your purchase.