Skip to content

Commit

Permalink
Merge branch 'master' into branch-migrate-tests-week3
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyang143 committed Feb 17, 2025
2 parents b3f9bac + 60b1543 commit 645e6ac
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/main/java/teammates/common/util/StringHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package teammates.common.util;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -179,7 +180,9 @@ public static <T> String toString(List<T> list, String delimiter) {
* Converts a double value between 0 and 1 to 3dp-string.
*/
public static String toDecimalFormatString(double doubleVal) {
DecimalFormat df = new DecimalFormat("0.###");
DecimalFormatSymbols syms = new DecimalFormatSymbols();
syms.setDecimalSeparator('.');
DecimalFormat df = new DecimalFormat("0.###", syms);
return df.format(doubleVal);
}

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/teammates/common/util/TimeHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Locale;

/**
* A helper class to hold time-related functions (e.g., converting dates to strings etc.).
Expand Down Expand Up @@ -105,7 +106,9 @@ public static String formatInstant(Instant instant, String timeZone, String patt
if (zonedDateTime.getHour() == 12 && zonedDateTime.getMinute() == 0) {
processedPattern = pattern.replace("a", "'NOON'");
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(processedPattern);
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern(processedPattern)
.withLocale(Locale.US);
return zonedDateTime.format(formatter);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void testIsInstructorCommentsOnResponsesAllowed_shouldReturnTrue() {
}

@Test
public void tesValidateResponseDetails() {
public void testValidateResponseDetails() {
FeedbackNumericalScaleQuestionDetails numScaleQuestion = new FeedbackNumericalScaleQuestionDetails();
numScaleQuestion.setStep(0.1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,79 @@ export class InstructorRequestFormComponent {
// Country Mapping
const countryMapping: { [key: string]: string } = {
'united states': 'USA',
'u.s.a': 'USA',
'u.s.a.': 'USA',
us: 'USA',
america: 'USA',
uk: 'United Kingdom',
deutschland: 'Germany',
'united states of america': 'USA',

'united kingdom': 'UK',
uk: 'UK',
britain: 'UK',
'great britain': 'UK',
england: 'UK',

'united arab emirates': 'UAE',
uae: 'UAE',
emirates: 'UAE',

deutschland: 'Germany',
germany: 'Germany',

netherlands: 'Netherlands',
'the netherlands': 'Netherlands',
nederland: 'Netherlands',
holland: 'Netherlands',

belgium: 'Belgium',
belgië: 'Belgium',

brazil: 'Brazil',
brasil: 'Brazil',

spain: 'Spain',
españa: 'Spain',

mexico: 'Mexico',
méxico: 'Mexico',
belgië: 'Belgium',
holland: 'Netherlands',

italy: 'Italy',
italia: 'Italy',

china: 'China',
'peoples republic of china': 'China',
prc: 'China',

france: 'France',
'republic of france': 'France',

india: 'India',

japan: 'Japan',

russia: 'Russia',
'russian federation': 'Russia',

'south korea': 'South Korea',
'republic of korea': 'South Korea',
korea: 'South Korea',

'north korea': 'North Korea',
'democratic peoples republic of korea': 'North Korea',

'south africa': 'South Africa',
'republic of south africa': 'South Africa',

switzerland: 'Switzerland',

turkey: 'Turkey',
'republic of turkey': 'Turkey',
'republic of türkiye': 'Turkey',

vietnam: 'Vietnam',
'viet nam': 'Vietnam',

malaysia: 'Malaysia',
};
// Combine country and institution
const country = this.country.value!.trim();
Expand Down

0 comments on commit 645e6ac

Please sign in to comment.