Commit 29543ef4 authored by Tanmim Hanifa's avatar Tanmim Hanifa

Date from string parsed to date

parent 11d09ae8
......@@ -6,6 +6,7 @@ import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.text.Spanned;
import android.text.format.DateFormat;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.Button;
......@@ -21,15 +22,22 @@ import com.android.volley.toolbox.Volley;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.SimpleDateFormat;
import java.util.Date;
public class RegisterActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
final EditText etDob = (EditText) findViewById(R.id.etDob);
final EditText etName = (EditText) findViewById(R.id.etName);
final EditText etUsername = (EditText) findViewById(R.id.etUsername);
......@@ -45,6 +53,8 @@ public class RegisterActivity extends AppCompatActivity {
final Button btnRegister = (Button) findViewById(R.id.btnRegister);
TextView tvTerms =(TextView)findViewById(R.id.tvTerms);
tvTerms.setClickable(true);
tvTerms.setMovementMethod(LinkMovementMethod.getInstance());
......@@ -68,6 +78,9 @@ public class RegisterActivity extends AppCompatActivity {
final String passwordAgain = etPasswordAgain.getText().toString();
Date cDate = new Date();
String fDate = new SimpleDateFormat(dob).format(cDate);
if(name.isEmpty()) {
AlertDialog.Builder builder2 = new AlertDialog.Builder(RegisterActivity.this);
builder2.setMessage("Name field is empty")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment