hyTags
HomeHome DocumentationDocumentation

date-set

Creates a new date with modified components
Parameter
Type
Description
self
Date
The date to modify
year
Number?
The new year (optional)
month
Number?
The new month (optional)
day
Number?
The new day (optional)
return
date
A new date with the modified components
Test Case:Set year on date
    <div></div>
    
    <date-new year="2024" month="6" day="15">
    <date-set year="2025">
    <date-get component="year">
    <assert-equal value="2025" type="number">
    
    👆 Try to change something!
  • Test Case:Set month on date
      <div></div>
      
      <date-new year="2024" month="6" day="15">
      <date-set month="12">
      <date-get component="month">
      <assert-equal value="12" type="number">
      
      👆 Try to change something!
    • Test Case:Set day on date
        <div></div>
        
        <date-new year="2024" month="6" day="15">
        <date-set day="1">
        <date-get component="day">
        <assert-equal value="1" type="number">
        
        👆 Try to change something!
      • Test succeeded Test failed