This commit is contained in:
Madeleine Vigier 2023-02-01 15:19:12 +01:00
parent deeabfd2ad
commit f1fabad17d

View File

@ -19,7 +19,7 @@ public class GeneralMethods {
* @author Madeleine Vigier
*/
public static String getDayNumberNew(String dateString) {
//https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
//https://stackoverflow.com/questions/8746084/string-to-localdate
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");
formatter = formatter.withLocale(Locale.GERMANY); // Locale specifies human language for translating, and cultural norms for lowercase/uppercase and abbreviations and such. Example: Locale.US or Locale.CANADA_FRENCH
LocalDate date = LocalDate.parse(dateString, formatter);
@ -32,7 +32,7 @@ public class GeneralMethods {
* The method getDayName() gets the weekday
*
* @param dayNumber dayNumber e.g. 1 for Monday
* @return weekday
* @return String weekday
* @author Madeleine Vigier
*/
public static String getDayName(int dayNumber) {