diff --git a/gradle.properties b/gradle.properties index a56766c..2155ed9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=1.1.1-SNAPSHOT +VERSION_NAME=1.1.1 GROUP=se.emilsjolander POM_DESCRIPTION=Sprinkles is a boiler-plate-reduction-library for dealing with databases in android applications diff --git a/sample/src/se/emilsjolander/sprinkles/CreateNoteActivity.java b/sample/src/se/emilsjolander/sprinkles/CreateNoteActivity.java index 173b328..92020ab 100644 --- a/sample/src/se/emilsjolander/sprinkles/CreateNoteActivity.java +++ b/sample/src/se/emilsjolander/sprinkles/CreateNoteActivity.java @@ -11,7 +11,6 @@ import android.widget.TextView; import java.text.SimpleDateFormat; -import java.util.Date; import java.util.Locale; import se.emilsjolander.sprinkles.models.Note; @@ -40,7 +39,7 @@ protected void onCreate(Bundle savedInstanceState) { noteContent.setText(mNote.getContent()); if (mNote.exists()) { - String updatedAtString = new SimpleDateFormat("HH:mm EEEE", Locale.getDefault()).format(new Date(mNote.getUpdatedAt())); + String updatedAtString = new SimpleDateFormat("HH:mm EEEE", Locale.getDefault()).format(mNote.getUpdatedAt()); lastUpdatedAt.setText(getString(R.string.last_updated, updatedAtString)); } else { lastUpdatedAt.setVisibility(View.GONE); diff --git a/sample/src/se/emilsjolander/sprinkles/models/Note.java b/sample/src/se/emilsjolander/sprinkles/models/Note.java index 783ac84..55a5153 100644 --- a/sample/src/se/emilsjolander/sprinkles/models/Note.java +++ b/sample/src/se/emilsjolander/sprinkles/models/Note.java @@ -1,5 +1,7 @@ package se.emilsjolander.sprinkles.models; +import java.util.Date; + import se.emilsjolander.sprinkles.Model; import se.emilsjolander.sprinkles.annotations.AutoIncrementPrimaryKey; import se.emilsjolander.sprinkles.annotations.Column; @@ -13,8 +15,8 @@ public class Note extends Model { @Column("id") private long id; @Column("content") private String content; - @Column("created_at") private long createdAt; - @Column("updated_at") private long updatedAt; + @Column("created_at") private Date createdAt; + @Column("updated_at") private Date updatedAt; @DynamicColumn("tag_count") private int tagCount; public long getId() { @@ -29,11 +31,11 @@ public void setContent(String content) { this.content = content; } - public long getCreatedAt() { + public Date getCreatedAt() { return createdAt; } - public long getUpdatedAt() { + public Date getUpdatedAt() { return updatedAt; } @@ -44,13 +46,13 @@ public int getTagCount() { @Override protected void beforeCreate() { super.beforeCreate(); - createdAt = System.currentTimeMillis(); + createdAt = new Date(); } @Override protected void beforeSave() { super.beforeSave(); - updatedAt = System.currentTimeMillis(); + updatedAt = new Date(); } }