Browse Source

Adds answers for telling the time, day of the week and the date.

master
Nero Ignis 5 years ago
parent
commit
945939cf9e
  1. 21
      .idea/workspace.xml
  2. 20
      app.js

21
.idea/workspace.xml

@ -5,9 +5,8 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e3f098f0-e98c-435a-af04-d153c9525633" name="Default Changelist" comment=""> <list default="true" id="e3f098f0-e98c-435a-af04-d153c9525633" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/kara.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/kara.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/index.html" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/app.js" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -48,7 +47,7 @@
<workItem from="1597348092890" duration="8205000" /> <workItem from="1597348092890" duration="8205000" />
<workItem from="1597530844649" duration="131000" /> <workItem from="1597530844649" duration="131000" />
<workItem from="1597577497243" duration="3353000" /> <workItem from="1597577497243" duration="3353000" />
<workItem from="1597583294362" duration="6641000" /> <workItem from="1597583294362" duration="7162000" />
</task> </task>
<task id="LOCAL-00001" summary="Adds gitignore."> <task id="LOCAL-00001" summary="Adds gitignore.">
<created>1597348071361</created> <created>1597348071361</created>
@ -281,7 +280,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1597589670240</updated> <updated>1597589670240</updated>
</task> </task>
<option name="localTasksCounter" value="34" /> <task id="LOCAL-00034" summary="Adds js for bootstrap &amp; moment.js;">
<created>1597607090595</created>
<option name="number" value="00034" />
<option name="presentableId" value="LOCAL-00034" />
<option name="project" value="LOCAL" />
<updated>1597607090595</updated>
</task>
<option name="localTasksCounter" value="35" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -307,17 +313,18 @@
<MESSAGE value="Adds settingsModal;&#10;Adds more saving;&#10;Disables saving welcomeBack messages;" /> <MESSAGE value="Adds settingsModal;&#10;Adds more saving;&#10;Disables saving welcomeBack messages;" />
<MESSAGE value="Adds wildcards for chat." /> <MESSAGE value="Adds wildcards for chat." />
<MESSAGE value="Change wildcards in html" /> <MESSAGE value="Change wildcards in html" />
<option name="LAST_COMMIT_MESSAGE" value="Change wildcards in html" /> <MESSAGE value="Adds js for bootstrap &amp; moment.js;" />
<option name="LAST_COMMIT_MESSAGE" value="Adds js for bootstrap &amp; moment.js;" />
</component> </component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state x="278" y="2" width="800" height="718" key="#Plugins" timestamp="1597350105557"> <state x="278" y="2" width="800" height="718" key="#Plugins" timestamp="1597350105557">
<screen x="0" y="0" width="1366" height="720" /> <screen x="0" y="0" width="1366" height="720" />
</state> </state>
<state x="278" y="2" width="800" height="718" key="#Plugins/0.0.1366.720@0.0.1366.720" timestamp="1597350105557" /> <state x="278" y="2" width="800" height="718" key="#Plugins/0.0.1366.720@0.0.1366.720" timestamp="1597350105557" />
<state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2" timestamp="1597589670193"> <state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2" timestamp="1597607090553">
<screen x="0" y="0" width="1366" height="720" /> <screen x="0" y="0" width="1366" height="720" />
</state> </state>
<state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2/0.0.1366.720@0.0.1366.720" timestamp="1597589670193" /> <state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2/0.0.1366.720@0.0.1366.720" timestamp="1597607090553" />
<state x="466" y="118" width="424" height="490" key="FileChooserDialogImpl" timestamp="1597353496276"> <state x="466" y="118" width="424" height="490" key="FileChooserDialogImpl" timestamp="1597353496276">
<screen x="0" y="0" width="1366" height="720" /> <screen x="0" y="0" width="1366" height="720" />
</state> </state>

20
app.js

@ -215,6 +215,26 @@ let kara = new Vue({
return false; return false;
} }
if (
this.includesAllOf(phrases, ['whats', 'the', 'time']) ||
this.includesAllOf(phrases, ['how', 'late'])
) {
return "It's " + moment().format('LT');
}
if (
this.includesAllOf(phrases, ['what', 'day', 'it'])
) {
return "It's " + moment().format('dddd') + ".";
}
if (
this.includesAllOf(phrases, ['what', 'date', 'it']) ||
this.includesAllOf(phrases, ['whats', 'the', 'date'])
) {
return "It's " + moment().format('dddd') + ", " + moment().format('MMMM Do YYYY') + ".";
}
this.answers.forEach((answerOption) => { this.answers.forEach((answerOption) => {
if (answerOption.includeAll === true) { if (answerOption.includeAll === true) {
if ( if (

Loading…
Cancel
Save