hyTags
HomeHome DocumentationDocumentation

time-get

Gets a specific component of a time.
Parameter
Type
Description
self
Time
The time to get the component from
component
String
The component to retrieve (hour, minute, or second)
return
number
The value of the specified time component
Test Case:Get hour component
    <div></div>
    
    <time-new hour="14" minute="30" second="45">
    <time-get component="hour">
    <assert-equal value="14" type="number">
    
    👆 Try to change something!
  • Test Case:Get minute component
      <div></div>
      
      <time-new hour="14" minute="30" second="45">
      <time-get component="minute">
      <assert-equal value="30" type="number">
      
      👆 Try to change something!
    • Test Case:Get second component
        <div></div>
        
        <time-new hour="14" minute="30" second="45">
        <time-get component="second">
        <assert-equal value="45" type="number">
        
        👆 Try to change something!
      • Test succeeded Test failed