Skip to content

Commit

Permalink
fix(publish): Support renewed Narou's new episode form
Browse files Browse the repository at this point in the history
Narou official updated their new episode form on 24 May

Closes #19
  • Loading branch information
io-monad committed May 26, 2016
1 parent 8abf180 commit 7e03fbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 3 additions & 5 deletions app/scripts/lib/sites/narou/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ function getCode(pub) {
};
if (pub.time) {
const time = moment(pub.time).tz("Asia/Tokyo");
embedPub.month = time.format("YYYY-MM");
embedPub.day = time.format("D");
embedPub.date = time.format("YYYY年M月D日");
embedPub.hour = time.format("H");
}
return `
Expand All @@ -49,9 +48,8 @@ function getCode(pub) {
form.subtitle.value = pub.title;
form.novel.value = pub.body;
if (pub.month && pub.day) {
form.month.value = pub.month;
form.day.value = pub.day;
if (pub.date) {
form.reserve_date.value = pub.date;
form.hour.value = pub.hour;
}
Expand Down
6 changes: 2 additions & 4 deletions test/lib/sites/narou/publish-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ describe("NarouPublish", () => {
assert.deepEqual(embedPub, {
title: pub.title,
body: pub.body,
month: "2016-03",
day: "1",
date: "2016年3月1日",
hour: "11",
});
});
Expand Down Expand Up @@ -59,8 +58,7 @@ describe("NarouPublish", () => {
assert.deepEqual(embedPub, {
title: pub.title,
body: pub.body,
month: "2016-03",
day: "1",
date: "2016年3月1日",
hour: "11",
});
});
Expand Down

0 comments on commit 7e03fbd

Please sign in to comment.