package cz.moneta.test.dsl.auto.smartauto.util;

import cz.moneta.test.harness.support.web.DynamicPathPart;

import java.util.Calendar;
import java.util.Locale;

import static org.apache.commons.lang3.StringUtils.capitalize;

public class MonthUtil implements DynamicPathPart {
    private final String month;

    public MonthUtil(String month) {
        this.month = month;
    }

    public static String getCurrentMonth() {
        Calendar cal = Calendar.getInstance();
        Locale loc = new Locale("cs", "CZ");
        return capitalize(cal.getDisplayName(Calendar.MONTH, Calendar.LONG_STANDALONE, loc));
    }

    @Override
    public String getValue() {
        return month;
    }
}
