diff --git a/src/synthale/recipes.py b/src/synthale/recipes.py
index 66bdaee..790c3a6 100644
--- a/src/synthale/recipes.py
+++ b/src/synthale/recipes.py
@@ -185,6 +185,7 @@ class MarkdownRecipe:
headers = ('Name', 'Origin', 'Alpha', 'Amount', 'Time', 'Use')
rows = []
for hop in self.recipe.hops:
+ # Determine hop unit
if self.hop_unit == 'pounds':
amt = convert.pounds(hop.amount, '.2f')
elif self.hop_unit == 'grams':
@@ -193,12 +194,19 @@ class MarkdownRecipe:
amt = convert.kilograms(hop.amount, '.2f')
else:
amt = convert.ounces(hop.amount, '.1f')
+
+ # Determine hop timing
+ if hop.use == 'Dry Hop':
+ # 1 day = 1440 minutes
+ time = '{:.1f} days'.format(hop.time / 1440.0)
+ else:
+ time = '{} min'.format(int(round(hop.time)))
rows.append((
hop.name,
hop.origin,
'{:.1f} %'.format(hop.alpha),
amt,
- '{}'.format(int(round(hop.time))),
+ time,
hop.use,
))
return (
diff --git a/tests/recipes/weizen.xml b/tests/recipes/weizen.xml
index 03885bd..a2d757e 100644
--- a/tests/recipes/weizen.xml
+++ b/tests/recipes/weizen.xml
@@ -76,6 +76,19 @@
60.0 min
+
+ Cascade
+ U.S.
+ 5.5
+
+ 0.0141747
+ 0.5 oz
+
+
+
+ 5 days
+
+
diff --git a/tests/test_recipes.py b/tests/test_recipes.py
index ccb8b06..eea12bb 100644
--- a/tests/test_recipes.py
+++ b/tests/test_recipes.py
@@ -128,9 +128,14 @@ def test_recipe_hops(md_weizen):
assert md_weizen.hops == (
'Hops\n'
'----\n'
- '| Name | Origin | Alpha | Amount | Time | Use |\n'
- '| -------------------- | ------- | ----- | ------ | ---- | ---- |\n'
- '| Northern Brewer (DE) | Germany | 4.9 % | 1.0 oz | 60 | Boil |'
+ '| Name | Origin | Alpha | Amount | Time |'
+ ' Use |\n'
+ '| -------------------- | ------- | ----- | ------ | -------- |'
+ ' ------- |\n'
+ '| Northern Brewer (DE) | Germany | 4.9 % | 1.0 oz | 60 min |'
+ ' Boil |\n'
+ '| Cascade | U.S. | 5.5 % | 0.5 oz | 5.0 days |'
+ ' Dry Hop |'
)