package com.hlgranite.warehousescanner;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.ArrayList;

/**
 * Created by yeang-shing.then on 9/27/13.
 */
public class WorkOrderAdapter extends ArrayAdapter<WorkOrder> {
    private final Context context;
    private final ArrayList<WorkOrder> values;

    public WorkOrderAdapter(Context context, ArrayList<WorkOrder> values) {
        super(context, R.layout.layout_workorder, values);
        this.context = context;
        this.values = values;
    }

    public View getView(int position, View contentView, ViewGroup parent) {
        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View rowView = inflater.inflate(R.layout.layout_workorder, parent, false);

        WorkOrder order = values.get(position);

        TextView textView = (TextView)rowView.findViewById(R.id.textView);
        textView.setText(order.getBarcode().toString());
        TextView textView3 = (TextView)rowView.findViewById(R.id.textView3);
        textView3.setText(order.getDate().toString());

        TextView textView2 = (TextView)rowView.findViewById(R.id.textView2);
        textView2.setText(order.getCustomer());
        TextView textView4 = (TextView)rowView.findViewById(R.id.textView4);
        textView4.setText(order.getReference());

        return rowView;
    }

}

@@ -228,16 +228,45 @@
 tView;%0A%0A
+import java.text.DateFormat;%0A
 import j
@@ -1134,24 +1134,110 @@
 oString());%0A
+        // see http://developer.android.com/reference/java/text/SimpleDateFormat.html%0A
         Text
@@ -1319,32 +1319,72 @@
 xtView3.setText(
+DateFormat.getDateTimeInstance().format(
 order.getDate().
@@ -1382,26 +1382,16 @@
 etDate()
-.toString(
 ));%0A%0A   

Format date in history page based on local phone setting.