Difference between revisions of "CompanyTimeline"

From Sega Retro

Line 4: Line 4:
 
{{#vardefine:starttime|{{#time: U | {{{startdate|0}}}-01-01}}}}{{#vardefine:totaltime|{{#expr:{{#time: U | {{{enddate|0}}}-01-01}} - {{#var:starttime}}}}}}
 
{{#vardefine:starttime|{{#time: U | {{{startdate|0}}}-01-01}}}}{{#vardefine:totaltime|{{#expr:{{#time: U | {{{enddate|0}}}-01-01}} - {{#var:starttime}}}}}}
  
{{#vardefine:height|{{#expr:({{{enddate|}}}-{{{startdate|}}})*2}}}}
+
{{#vardefine:height|100}}
  
 
<div style="width:100%; background-color:#FF0000; padding:2px; line-height:0px; height:{{#var:height}}px">
 
<div style="width:100%; background-color:#FF0000; padding:2px; line-height:0px; height:{{#var:height}}px">
Line 10: Line 10:
 
| {{#ifexpr:{{#var:i}} < {{{enddate|}}}|true}}
 
| {{#ifexpr:{{#var:i}} < {{{enddate|}}}|true}}
 
| {{#vardefine:labelstartdate|{{#var:i}}-01-01}}{{#vardefine:labelx|{{#expr:(({{#time: U |{{#var:labelstartdate}}}}-{{#var:starttime}}) / {{#var:totaltime}}) * 100}}}}
 
| {{#vardefine:labelstartdate|{{#var:i}}-01-01}}{{#vardefine:labelx|{{#expr:(({{#time: U |{{#var:labelstartdate}}}}-{{#var:starttime}}) / {{#var:totaltime}}) * 100}}}}
<div style="position:relative; left:{{#var:labelx}}%; height:{{#var:height}}px; width:0px; border-left:1px solid #00FF00; {{#ifexpr:{{#var:count}}>0|margin-top:-80px;}}"></div>
+
<div style="position:relative; top:{{#var:height}}px; left:{{#var:labelx}}%; height:{{#var:height}}px; width:0px; border-left:1px solid #00FF00; margin-top:-{{#var:height}}px;"></div>
 
{{incvar|i}}{{incvar|count}}
 
{{incvar|i}}{{incvar|count}}
 
}}{{clearvar|i}}{{{1|}}}
 
}}{{clearvar|i}}{{{1|}}}

Revision as of 16:00, 27 July 2022


Clock.svg
This task is unfinished
This is a wiki task that requires more thought or peer review. An important issue that needs to be solved, which will appear at the top of Sega Retro:Todo until this message is removed.

Replacement for Template:Timeline. I might be able to automate the dates - won't that be fun. -Black Squirrel (talk) 14:34, 27 July 2022 (EDT)