Conversation
DateMathDescription: calculate the date with an offset Example Query: Jan 1 2012 plus 32 days, 1/1/2012 plus 5 months, January first minus ten days, in 5 weeks, 2 weeks ago, 1 month from today, 3 seconds ago, time now + 16 minutes, 4 hours from now Tab Name: Answer Source: These are the important fields from the IA page. Please check these for errors or missing information and update the IA page This is an automated message which will be updated as changes are made to the IA page |
@mintsoft Want to have a look over this? I think the functionality is all there; just a question of getting it to look nice. I'll have another look pretty soon to make sure I've removed everything that should be, and clean up anything that requires it. |
@GuiltyDolphin certainly can |
Hmm so I'm a smidge confused by the GUI at first; I've just played with it and it made more sense once I could see how it reacted. @abeyang Any design thoughts here? |
@mintsoft Glad it made sense (eventually)! I'm no designer so any design review is appreciated. |
@GuiltyDolphin Immediate things that I've noticed are that I think some labels might help?
|
Also it doesn't give me the answer when I query? I have to tinker with it to get the answer out? |
Oh lord @mintsoft yeah - forgot to turn that on! |
@mintsoft Sure - I was using a random format suggested by I would like locale formats but... |
Ah somehow I knew it'd be |
@GuiltyDolphin I think my confusion around the input boxes is because that line is small and you highlight things like the sunday it makes it look like it's just text. Maybe if you did |
Hmm maybe change them to |
@mintsoft I had that (spinners) before - it was pretty ugly. There is the indication when you hover over (a caret); but I guess we could make the highlighting a bit more prominent - I'll see how it looks. |
Just looking over this. My initial reaction is that there's too much JS here. It looks like a lot of what you've implemented can be handled by the browser:
|
'Second', 'Minute', 'Hour', | ||
'Day', 'Week', 'Month', 'Year' | ||
]; | ||
function pad(text, padChar, padWidth) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move private functions outside the build
function definition
34ca44f - I was using I am using Thanks for the review 😄 |
@moollaza BTW, which (specifically) were you thinking should be switched to The times get really screwed up as well. Am I missing something? It feels like there should be a way to not have it screw everything up and just have the input type; though looking at other IAs they've used things like |
15a2ceb
to
ec439ef
Compare
Unfortunately I couldn't find a class for tx--10 (unless it is one of the named ones), so I've used tx--11 for now.
Use the plural version for modifier display names; possibly make it change according to whether the amount is 1?
And a bit o' a cleanup.
Using 'operation' and 'sign' rather than 'actions'. TODO: Update the tests to only have one possible action.
0d73ebf
to
9abb0df
Compare
@tagawa I'll just revert the changes to the date input - they can't complain if it is a text field. Hmm... Locally the boxes wrap for me, but on Beta it's fine, weird... (I'm on FF). |
<p class="frm__desc pull--left tx--11">DURATION</p> | ||
<span class="frm op--select"> | ||
<input type="number" class="frm__input input--op-amt g forty"/> | ||
<span class="frm__select g fifty" style="height:2em"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use !important
to override CSS -- inline styles shouldn't be necessary -- or give these another class and create a more specific selector than .frm .frm__select
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moollaza See my comment above - I've tried using CSS with multiple classes + id + tag etc. (with !important
) to no avail - unless I'm missing something obvious it looks like I can't override them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.zci--date_math .frm__select.g
seems to work?
OR
.zci--date_math .frm__select.date--selection
if you want it to be more precise
@moollaza Uhh, that appears to be missing the sign toggle? On Midori it takes it from: To: (I've played around with it a bit). I'm not 100% sure what the issue is - on FF it looks screwed up locally, but on Beta it's fine. Could it just be something to do with slightly different styles on Beta and what DuckPAN receives? |
@GuiltyDolphin looks like your pictures didn't upload in that last comment?
I'll take a look at FF...
Shouldn't be. If any, it would only be minor and temporary (once Beta is updated internally). AFAIK we haven't made any changes to CSS lately. |
<span class="frm op--select"> | ||
<input type="number" class="frm__input input--op-amt g forty"/> | ||
<span class="frm__select g fifty" style="height:2em"> | ||
<select class="input--op-type" style="height:2em"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can use .frm__select select.input--op-type
with !important
here.
Our existing DDG style has !important
so we need to make our selector more specific first, then force it with !important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to also remove the padding on the select
as the span
already adds some, forcing the seconds
option to overlap with the dropdown
@GuiltyDolphin if you reduce the padding-left on the It may be wrapping due to some kind of calculation bug in FF... Not sure why the math isn't adding up there. |
I'm going to close this for now until we decide what we want to do with it, feel free to re-open if you disagree |
This adds interactivity to the DateMath Goodie through JavaScript.
Hide your eyes.
To-Do
Years: X Months: X etc.
with support for changing the operation from addition to subtraction.IA Page: https://duck.co/ia/view/date_math