use of com.alexstyl.specialdates.events.namedays.NamedayBundle in project Memento-Calendar by alexstyl.
the class RomanianNamedays method calculateEasterIfNecessary.
private void calculateEasterIfNecessary(int year) {
if (romanianDate == null || romanianDate.getYear() != year) {
romanianDate = calculator.calculateSpecialRomanianDayForYear(year);
NamedaysList dateToNames = new NamedaysList();
CharacterNode namesToDate = new CharacterNode();
for (String name : names) {
dateToNames.addNameday(romanianDate, name);
namesToDate.addDate(name, romanianDate);
}
namedays = new NamedayBundle(namesToDate, dateToNames);
}
}
use of com.alexstyl.specialdates.events.namedays.NamedayBundle in project Memento-Calendar by alexstyl.
the class SpecialGreekNamedaysCalculator method calculateForEasterDate.
NamedayBundle calculateForEasterDate(Date easter) {
Node node = new SoundNode();
NamedaysList namedaysList = new NamedaysList();
for (EasternNameday easternNameday : easternNamedays) {
int daysUntilEaster = easternNameday.getDateToEaster();
Date date = easter.addDay(daysUntilEaster);
for (String name : easternNameday.getNamesCelebrating()) {
node.addDate(name, date);
namedaysList.addNameday(date, name);
}
}
appendSpecialScenarios(easter, node, namedaysList);
return new NamedayBundle(node, namedaysList);
}
use of com.alexstyl.specialdates.events.namedays.NamedayBundle in project Memento-Calendar by alexstyl.
the class GreeklishParserTest method alexandrosNamedayIsReturnedCorrectly.
@Test
public void alexandrosNamedayIsReturnedCorrectly() {
NamedayBundle namedayBundle = NamedayJSONParser.getNamedaysFromJSONasSounds(namedayJSON);
NameCelebrations dates = namedayBundle.getDatesFor("Αλέξανδρος");
NameCelebrations datesGreeklish = namedayBundle.getDatesFor("Aleksandros");
assertThatContainsSamedate(dates, datesGreeklish);
}
use of com.alexstyl.specialdates.events.namedays.NamedayBundle in project Memento-Calendar by alexstyl.
the class NamedayJSONParserTest method returningBundleHasNames.
@Test
public void returningBundleHasNames() {
NamedayBundle namedayBundle = NamedayJSONParser.getNamedaysFrom(namedayJSON);
assertThat(namedayBundle.getNames()).isNotEmpty();
}
use of com.alexstyl.specialdates.events.namedays.NamedayBundle in project Memento-Calendar by alexstyl.
the class NamedayJSONParserTest method amaliaNamedayIsReturnedCorrectly.
@Test
public void amaliaNamedayIsReturnedCorrectly() {
NamedayBundle namedayBundle = NamedayJSONParser.getNamedaysFrom(namedayJSON);
NameCelebrations dates = namedayBundle.getDatesFor("Αμαλία");
assertThatContainsDate(dates, Date.Companion.on(10, JULY));
}
Aggregations