Permalink
Browse files

Fixed the duration formatting on exports.

  • Loading branch information...
Kadauchi committed Nov 14, 2018
1 parent 52cb155 commit a36deae835b58229e8114917c15b8605c9011be3
Showing with 6,186 additions and 4 deletions.
  1. +2 −1 background/.eslintrc.json
  2. +3 −3 background/hit-exporter.js
  3. +1,673 −0 js/moment-duration-format.js
  4. +4,506 −0 js/moment.js
  5. +2 −0 manifest.json
@@ -4,6 +4,7 @@
"MturkDate": false,
"StorageGetKey": false,
"HTML": false,
"ENCODE": false
"ENCODE": false,
"moment": false
}
}
@@ -237,7 +237,7 @@ function plainTemplate(hit) {
Requester: ${requester_name} • https://worker.mturk.com/requesters${requester_id}/projects
${reviews}
Reward: ${reward}
Duration: ${duration}
Duration: ${moment.duration(duration, "seconds").format()}
Available: ${assignable_hits_count}
Description: ${description}
Qualifications: ${qualifications}`;
@@ -315,7 +315,7 @@ function bbCodeTemplate(hit) {
const template = `[table][tr][td][b]Title:[/b] [url="https://worker.mturk.com/projects/${hit_set_id}/tasks"]${title}[/url] | [url="https://worker.mturk.com/projects/${hit_set_id}/tasks/accept_random"]Accept[/url]
[b]Requester:[/b] [url="https://worker.mturk.com/requesters/${requester_id}/projects"]${requester_name}[/url] [${requester_id}] [url="https://worker.mturk.com/contact_requester/hit_type_messages/new?hit_type_message[hit_type_id]=YOURMTURKHIT&hit_type_message[requester_id]=${requester_id}"]Contact[/url]
${reviews}[b]Reward:[/b] ${reward}
[b]Duration:[/b] ${duration}
[b]Duration:[/b] ${moment.duration(duration, "seconds").format()}
[b]Available:[/b] ${assignable_hits_count}
[b]Description:[/b] ${description}
[b]Qualifications:[/b] ${qualifications}[/td][/tr][/table]`;
@@ -393,7 +393,7 @@ function markdownTemplate(hit) {
${await markdownTemplateReviews(hit)}**Reward:** $${
hit.monetary_reward.amount_in_dollars
}
**Duration:** ${hit.assignment_duration_in_seconds}
**Duration:** ${moment.duration(hit.assignment_duration_in_seconds, "seconds").format()}
**Available:** ${hit.assignable_hits_count}
**Description:** ${hit.description}
**Qualifications:** ${hit.project_requirements
Oops, something went wrong.

0 comments on commit a36deae

Please sign in to comment.