Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Commit

Permalink
Beginning work on tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
donnielrt committed Sep 28, 2012
1 parent 0900172 commit d5b8184
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
4 changes: 2 additions & 2 deletions public/js/app/models/quest.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ define(['backbone', 'backbone-validate', 'moment'], function(Backbone, validatio
}

// "6 days from now formatting"
//response.humanFriendlyDeadline = deadline.fromNow();
response.deadline = deadline.fromNow();
response.humanFriendlyDeadline = deadline.fromNow();
response.deadline = deadline.format("MM/DD/YYYY");

} else {
response.deadline = "date missing or invalid";
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/templates/quests/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
%>
<li class="quest-item<%= newRow %>">
<a href="#quests/<%= quest._id %>"><h2><%= quest.name %></h2></a>
<p><%= quest.description %> &mdash; <span class="deadline <%= quest.deadlineStatus %>">Due <%= quest.deadline %></span></p>
<p><%= quest.description %> &mdash; <span class="deadline <%= quest.deadlineStatus %>">Due <%= quest.humanFriendlyDeadline %></span></p>
<p>Status: <span class="status"><%= quest.status %></span></p>

<p><a class="btn" href="#quests/<%= quest._id %>">View details &raquo;</a></p>
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/templates/quests/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>

<div class="row-fluid">
<div class="span12"><%= description %> &mdash; <span class="deadline<%= deadlineStatus %>">Due <%= deadline %></span></div>
<div class="span12"><%= description %> &mdash; <span class="deadline<%= deadlineStatus %>">Due <%= humanFriendlyDeadline %></span></div>
</div>

<div class="row-fluid">
Expand Down
20 changes: 7 additions & 13 deletions public/js/app/views/quests/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ define([
'text!templates/quests/single.html',
'text!templates/quests/_item.html',
'text!templates/quests/form.html',
'datejs',
'rangepicker',
'moment'],
'rangepicker'],
function(
Backbone,
Questience,
Expand All @@ -17,9 +15,7 @@ define([
singleQuestTemplate,
questItemTemplate,
questFormTemplate,
Date,
rangePicker,
moment){
daterangepicker){

"use strict";

Expand Down Expand Up @@ -57,8 +53,9 @@ define([
{text: 'This week', dateStart: 'Today+7', dateEnd: 'Today+7' },
{text: 'Next 30 Days', dateStart: 'Today+30', dateEnd: 'Today+30' }
],
presets: []

presets: {
specificDate: 'Specific Date'
}
});

});
Expand All @@ -75,18 +72,15 @@ define([

saveQuest: function() {

var result,
deadlineDate = this.$("input[name='deadline']").val(); // we show a human-friendly string in the actual value field
var result;

this.model.set({
name: this.$("input[name='name']").val(),
description: this.$("textarea[name='description']").val(),
deadline: deadlineDate,
deadline: this.$("input[name='deadline']").val(),
status: this.$("select[name='status']").val()
});

console.log("Parsing: ", dateJs);

this.collection = new Quests();

if (this.model.isNew()) {
Expand Down
16 changes: 8 additions & 8 deletions public/js/libs/plugins/date.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5b8184

Please sign in to comment.