<commit_before>package com.mapswithme.maps.editor.data;

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.IntRange;
import android.text.format.DateFormat;

import com.mapswithme.maps.MwmApplication;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;

public class HoursMinutes implements Parcelable
{
  public final long hours;
  public final long minutes;

  public HoursMinutes(@IntRange(from = 0, to = 23) long hours, @IntRange(from = 0, to = 59) long minutes)
  {
    this.hours = hours;
    this.minutes = minutes;
  }

  protected HoursMinutes(Parcel in)
  {
    hours = in.readLong();
    minutes = in.readLong();
  }

  private boolean is24HourFormat() { return DateFormat.is24HourFormat(MwmApplication.get()); }

  @Override
  public String toString()
  {
    if (is24HourFormat())
      return String.format(Locale.US, "%02d:%02d", hours, minutes);

    Calendar calendar = new GregorianCalendar();
    calendar.set(Calendar.HOUR, (int)hours);
    calendar.set(Calendar.MINUTE, (int)minutes);

    SimpleDateFormat fmt12 = new SimpleDateFormat("hh:mm a");

    return fmt12.format(calendar.getTime());
  }

  @Override<commit_msg>fix am/pm<commit_after>package com.mapswithme.maps.editor.data;

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.IntRange;
import android.text.format.DateFormat;

import com.mapswithme.maps.MwmApplication;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;

public class HoursMinutes implements Parcelable
{
  public final long hours;
  public final long minutes;

  public HoursMinutes(@IntRange(from = 0, to = 23) long hours, @IntRange(from = 0, to = 59) long minutes)
  {
    this.hours = hours;
    this.minutes = minutes;
  }

  protected HoursMinutes(Parcel in)
  {
    hours = in.readLong();
    minutes = in.readLong();
  }

  private boolean is24HourFormat() { return DateFormat.is24HourFormat(MwmApplication.get()); }

  @Override
  public String toString()
  {
    if (is24HourFormat())
      return String.format(Locale.US, "%02d:%02d", hours, minutes);

    Calendar calendar = new GregorianCalendar();
    calendar.set(Calendar.HOUR_OF_DAY, (int)hours);
    calendar.set(Calendar.MINUTE, (int)minutes);

    SimpleDateFormat fmt12 = new SimpleDateFormat("hh:mm a");

    return fmt12.format(calendar.getTime());
  }

  @Override
{'fraction_non_alphanumeric': 0.11668657905217045, 'fraction_numerical': 0.01592990840302668, 'mean_word_length': 4.379014989293362, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2494950', 'n_tokens_mistral': 852, 'n_tokens_neox': 785, 'n_words': 178}