Skip to content

Commit

Permalink
fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonasdan committed Sep 7, 2021
1 parent 707a571 commit cab1ccf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 101 deletions.
2 changes: 1 addition & 1 deletion docs/6/js/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
{
"file": "migration.html",
"title": "Migration",
"body": "this tool attempts to convert your configurations from previous version of the picker v paste current configuration into input box due how process works it cannot usages moment or date objects set any property that uses unsupported values undefined so can still be converted for more information on what's changed check out change log if you find a bug doesn't work please open an issue locale pt-br buttons showtoday true showclear showclose icons time far fa-clock fa-calendar-alt up fas fa-arrow-up down fa-arrow-down fa-chevron-left next fa-chevron-right today fa-calendar-check clear fa-trash-alt close fa-times tooltips selectdate calendário selecttime horário hoje/agora limpar fechar selectmonth seleciona mês prevmonth anterior nextmonth próximo selectyear ano prevyear nextyear selectdecade década prevdecade nextdecade próxima prevcentury céculo passado nextcentury incrementhour aumentar hora pickhour decrementhour diminuir incrementminute minuto pickminute decrementminute incrementsecond segundo picksecond decrementsecond output try settings here you're using old fa differnt icon family won't show results exception is no longer used accepted value either config use remove there's just way i could every possible something new well with functions object initalizers will have replace those calls suggestions improve let me know const document.getelementbyid('from document.getelementbyid('to convertbutton document.getelementbyid('convertbutton alertbox document.getelementbyid('alert datetimepicker tempusdominus.tempusdominus(document.getelementbyid('datetimepicker convertedconfiguration createalert message style div document.createelement('div div.classname alert alert-${style alert-dismissible fade div.innerhtml message}<button type='button class='btn-close data-bs-dismiss='alert aria-label='close'></button alertbox.appendchild(div alertbox.innerhtml output.value input.value was provided return value.includes('moment can\\'t see danger value.match(/\\(|\\)|<|>/gi parse initializations like function('\"use strict\";return newoptions prop obj obj[prop else ensurepath paths paths.split('.').reduce((value key prop(key)(value differentaccepts viewmode toolbarplacement'].includes(key createalert(`${key takes different verify option warning object.entries(config).foreach(([key differentaccepts(key switch case format createalert('format determine component display href=\"options.html#displaycomponents target=\"_blank\">component usage</a and href=\"options.html#displayinputformat target=\"_blank\">input formatting</a ensurepath('display newoptions.display.components calendar month year decades clock hours minutes seconds false usetwentyfourhour break sidebyside calendarweeks toolbarplacement inline newoptions.display[key dayviewheaderformat createalert('moment supported now accepts intl formats href=\"options.html#localizationdayviewheaderformat target=\"_blank\">localization ensurepath('localization newoptions.localization.dayviewheaderformat long extraformats collapse usestrict widgetpositioning widgetparent keybinds ignorereadonly focusonshow parseinputdate timezone ignored mindate maxdate enableddates disableddates enabledhours disabledhours daysofweekdisabled ensurepath('restrictions newoptions.restrictions[key disabledtimeintervals createalert('this expects array code x y}</code href=\"options.html#restrictionsdisabledtimeintervals target=\"_blank\">usage</a newoptions.restrictions.restrictions usecurrent stepping defaultdate keepopen keepinvalid debug allowinputtoggle viewdate newoptions[key languages href=\"options.html#localizationlocale newoptions.localization.locale showtodaybutton ensurepath('display.buttons handlebutton k newoptions.display.buttons[k.replace('show replace('button tolowercase object.entries(value).foreach(([k handlebutton(k handlebutton(key k.startswith('prev k.replace('prev newoptions.localization[k allowmultidate newoptions.multipledates multidateseparator newoptions.multipledatesseparator outputvalue n spacing readme object.entries(obj).foreach(([key array.isarray(value typeof array(spacing).fill join readme(value value}],\\n string value},\\n readme(newoptions catch e createalert(`something went wrong trying perform conversion report settings.<br/>${e convertbutton.addeventlistener('click input.addeventlistener('change document.getelementbyid('tryit').addeventlistener('click run hasn't been some reason then there error datetimepicker1.updateoptions(convertedconfiguration textarea height vh hide right side toc give room media min-width px bd-main grid gap inherit grid-template-areas intro content grid-template-rows auto fr position relative top grid-template-columns max-height overflow-y scroll",
"body": "version defaults to fa icons but will switch when that's released removes moment jquery and bootstrap as depedencies it also uses popper.js v this tool attempts convert your configurations from previous of the picker paste current configuration into input box due how process works cannot usages or date objects set any property that unsupported values undefined so can still be converted for more information on what's changed check out change log if you find a bug doesn't work please open an issue output try settings here you're using old differnt icon family won't show results exception is no longer used accepted value either config use remove there's just way i could every possible something new well with functions object initalizers have replace those calls suggestions improve let me know const document.getelementbyid('from document.getelementbyid('to convertbutton document.getelementbyid('convertbutton alertbox document.getelementbyid('alert datetimepicker tempusdominus.tempusdominus(document.getelementbyid('datetimepicker convertedconfiguration createalert message style div document.createelement('div div.classname alert alert-${style alert-dismissible fade div.innerhtml message}<button type='button class='btn-close data-bs-dismiss='alert aria-label='close'></button alertbox.appendchild(div alertbox.innerhtml output.value input.value was provided return value.includes('moment can\\'t see danger value.match(/\\(|\\)|<|>/gi parse initializations like function('\"use strict\";return newoptions prop obj obj[prop else ensurepath paths paths.split('.').reduce((value key prop(key)(value differentaccepts viewmode toolbarplacement'].includes(key createalert(`${key takes different verify option warning object.entries(config).foreach(([key differentaccepts(key case format createalert('format determine component display href=\"options.html#displaycomponents target=\"_blank\">component usage</a href=\"options.html#displayinputformat target=\"_blank\">input formatting</a ensurepath('display newoptions.display.components calendar true month year decades clock hours minutes seconds false usetwentyfourhour break sidebyside calendarweeks toolbarplacement inline newoptions.display[key dayviewheaderformat createalert('moment supported now accepts intl formats href=\"options.html#localizationdayviewheaderformat target=\"_blank\">localization ensurepath('localization newoptions.localization.dayviewheaderformat long extraformats collapse usestrict widgetpositioning widgetparent keybinds ignorereadonly focusonshow parseinputdate timezone ignored mindate maxdate enableddates disableddates enabledhours disabledhours daysofweekdisabled ensurepath('restrictions newoptions.restrictions[key disabledtimeintervals createalert('this expects array code x y}</code href=\"options.html#restrictionsdisabledtimeintervals target=\"_blank\">usage</a newoptions.restrictions.restrictions usecurrent stepping defaultdate keepopen keepinvalid debug allowinputtoggle viewdate newoptions[key locale languages href=\"options.html#localizationlocale newoptions.localization.locale showtodaybutton showclear showclose buttons ensurepath('display.buttons handlebutton k newoptions.display.buttons[k.replace('show replace('button tolowercase object.entries(value).foreach(([k handlebutton(k handlebutton(key tooltips k.startswith('prev k.replace('prev newoptions.localization[k allowmultidate newoptions.multipledates multidateseparator newoptions.multipledatesseparator outputvalue n spacing readme object.entries(obj).foreach(([key array.isarray(value typeof array(spacing).fill join readme(value value}],\\n string value},\\n readme(newoptions catch e createalert(`something went wrong trying perform conversion report settings.<br/>${e convertbutton.addeventlistener('click input.addeventlistener('change document.getelementbyid('tryit').addeventlistener('click run hasn't been some reason then there error datetimepicker1.updateoptions(convertedconfiguration textarea height vh hide right side toc give room media min-width px bd-main grid gap inherit grid-template-areas intro content grid-template-rows auto fr position relative top grid-template-columns max-height overflow-y scroll",
"postDate": "07/08/2021",
"updateDate": "07/08/2021",
"excerpt": "How to use Tempus Dominus datetime picker\n ",
Expand Down
54 changes: 5 additions & 49 deletions docs/6/migration.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ <h1 class="bd-title title" id="content">Migration</h1>
</div>
<div id="mainContent" class="bd-content ps-lg-4">
<div id="migration">
<p>
Version 6 defaults to FA 5 icons (but will switch to FA 6 when that's released), removes moment, jQuery and
Bootstrap as depedencies. It also uses Popper.js v2.
</p>
<p>
This tool attempts to convert your configurations from previous version of the picker to v6. Paste your current
configuration into the input box. Due to how this process works, it cannot convert usages of moment or date
Expand All @@ -241,53 +245,7 @@ <h1 class="bd-title title" id="content">Migration</h1>
<div class="row">
<div class="col">
<label for="from" class="form-label">Input</label>
<textarea id="from" class="form-control">{
locale: 'pt-BR',
buttons: {
showToday: true,
showClear: true,
showClose: true
},
icons: {
time: 'far fa-clock',
date: 'far fa-calendar-alt',
up: 'fas fa-arrow-up',
down: 'fas fa-arrow-down',
previous: 'fas fa-chevron-left',
next: 'fas fa-chevron-right',
today: 'far fa-calendar-check',
clear: 'far fa-trash-alt',
close: 'fas fa-times'
},
tooltips: {
selectDate: 'Calendário',
selectTime: 'Horário',
today: 'Hoje/Agora',
clear: 'Limpar',
close: 'Fechar',
selectMonth: 'Seleciona Mês',
prevMonth: 'Mês Anterior',
nextMonth: 'Próximo Mês',
selectYear: 'Seleciona Ano',
prevYear: 'Ano Anterior',
nextYear: 'Próximo Ano',
selectDecade: 'Seleciona Década',
prevDecade: 'Década Anterior',
nextDecade: 'Próxima Década',
prevCentury: 'Céculo Passado',
nextCentury: 'Próximo Céculo',
incrementHour: 'Aumentar Hora',
pickHour: 'Seleciona Hora',
decrementHour: 'Diminuir Hora',
incrementMinute: 'Aumentar Minuto',
pickMinute: 'Seleciona Minuto',
decrementMinute: 'Diminuir Minuto',
incrementSecond: 'Aumentar Segundo',
pickSecond: 'Seleciona Segundo',
decrementSecond: 'Diminuir Segundo'
}
}
</textarea>
<textarea id="from" class="form-control"></textarea>
</div>
<div class="col-sm-1">
<button class="btn btn-primary" id="convertButton"><i class="fas fa-angle-double-right"></i></button>
Expand Down Expand Up @@ -540,8 +498,6 @@ <h3>Exception 2</h3>

datetimepicker1.updateOptions(convertedConfiguration);
});

convert();
</script>
<style>
textarea {
Expand Down
2 changes: 1 addition & 1 deletion docs/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'>
<url>
<loc>https://getdatepicker.com</loc>
<lastmod>2021-09-07T21:08:06.479Z</lastmod>
<lastmod>2021-09-07T22:22:59.856Z</lastmod>
<priority>1.00</priority>
</url>
<url>
Expand Down
55 changes: 5 additions & 50 deletions src/docs/partials/migration.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<page-body>
<div id='migration'>
<p>
Version 6 defaults to FA 5 icons (but will switch to FA 6 when that's released), removes moment, jQuery and
Bootstrap as depedencies. It also uses Popper.js v2.
</p>
<p>
This tool attempts to convert your configurations from previous version of the picker to v6. Paste your current
configuration into the input box. Due to how this process works, it cannot convert usages of moment or date
Expand All @@ -17,54 +21,7 @@
<div class='row'>
<div class='col'>
<label for='from' class='form-label'>Input</label>
<textarea id='from' class='form-control'>
{
locale: 'pt-BR',
buttons: {
showToday: true,
showClear: true,
showClose: true
},
icons: {
time: 'far fa-clock',
date: 'far fa-calendar-alt',
up: 'fas fa-arrow-up',
down: 'fas fa-arrow-down',
previous: 'fas fa-chevron-left',
next: 'fas fa-chevron-right',
today: 'far fa-calendar-check',
clear: 'far fa-trash-alt',
close: 'fas fa-times'
},
tooltips: {
selectDate: 'Calendário',
selectTime: 'Horário',
today: 'Hoje/Agora',
clear: 'Limpar',
close: 'Fechar',
selectMonth: 'Seleciona Mês',
prevMonth: 'Mês Anterior',
nextMonth: 'Próximo Mês',
selectYear: 'Seleciona Ano',
prevYear: 'Ano Anterior',
nextYear: 'Próximo Ano',
selectDecade: 'Seleciona Década',
prevDecade: 'Década Anterior',
nextDecade: 'Próxima Década',
prevCentury: 'Céculo Passado',
nextCentury: 'Próximo Céculo',
incrementHour: 'Aumentar Hora',
pickHour: 'Seleciona Hora',
decrementHour: 'Diminuir Hora',
incrementMinute: 'Aumentar Minuto',
pickMinute: 'Seleciona Minuto',
decrementMinute: 'Diminuir Minuto',
incrementSecond: 'Aumentar Segundo',
pickSecond: 'Seleciona Segundo',
decrementSecond: 'Diminuir Segundo'
}
}
</textarea>
<textarea id='from' class='form-control'></textarea>
</div>
<div class='col-sm-1'>
<button class='btn btn-primary' id='convertButton'><i class='fas fa-angle-double-right'></i></button>
Expand Down Expand Up @@ -332,8 +289,6 @@ <h3>Exception 2</h3>

datetimepicker1.updateOptions(convertedConfiguration);
});

convert();
</script>
<style>
textarea {
Expand Down

0 comments on commit cab1ccf

Please sign in to comment.