Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Task Timestamps #101

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/main/scala/model/Task.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package model

import java.text.SimpleDateFormat
import java.util.Calendar

import play.api.libs.json.{JsValue, Json}


Expand All @@ -21,7 +24,11 @@ object Task {
def apply(title: String, description: String): Task = {
val thisId = nextId
nextId += 1
new Task(cleanString(title), cleanString(description, 1000), thisId.toString)

val format = new SimpleDateFormat(" '[Created on' EEE, MMM dd 'at' hh:mm aa']'")
val dateCreated = format.format(Calendar.getInstance().getTime())

new Task(cleanString(title), cleanString(description, 1000) + dateCreated, thisId.toString)
}


Expand Down
38 changes: 38 additions & 0 deletions todo-scheduler.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/scala" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.typesafe.play:play-json_2.12:2.7.1" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.8" level="project" />
<orderEntry type="library" name="Maven: com.typesafe.play:play-functional_2.12:2.7.1" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-reflect:2.12.8" level="project" />
<orderEntry type="library" name="Maven: org.typelevel:macro-compat_2.12:1.1.1" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.10.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.15" level="project" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
<orderEntry type="library" name="Maven: com.corundumstudio.socketio:netty-socketio:1.7.12" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-epoll:4.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.28" level="project" />
<orderEntry type="library" name="scala-sdk-2.12.12" level="application" />
</component>
</module>