Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .bg.indigo

.container.white.z-depth-1
  .row
    .col.s12
      h2 Later.js test parser for parse.text()
      p I found myself spending way to much time debugging my cronjobs. So I build a little app to help identify problems:
    .col.s12.l6
      h4 input
      p.small add "; n" at the end to specify how many results should be shown (n = number of dates; 2 < n < 40)
      .input-field
        label(for="textp") Text to parse
        input(type="text" id="textp" value="every 15 minutes; 10")
      //b (optional) code to run
      //.input-field
        textarea.materialize-textarea#code
        label(for="code") Will not run when omitted
      p.small
        a(href="https://bunkat.github.io/later/parsers.html#text" target="_blank") Documentation
      p.small This has some isues with timezones. You almost allways have to subtract your timezone. For example writing "at 1:00 am" will result in "3:00" (if your are +200 CEST).
        
    .col.s12.l6
      h4 Next <span class="n-runs">10</span> runs:
      pre <ul class="date-list"></ul>
      
    .col.s12
      h5 License
      pre Copyright © 2000 Anton Lydike
        |This program is free software. It comes without any warranty, to
        |the extent permitted by applicable law. You can redistribute it
        |and/or modify it under the terms of the Do What The Fuck You Want
        |To Public License, Version 2, as published by Sam Hocevar. 
        |See <a href="http://www.wtfpl.net/" target="_blank">http://www.wtfpl.net/</a> for more details.
              
            
!

CSS

              
                .bg {
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:380px;
  
  z-index:-1;
}

.container {
  position:relative;
  border-radius:3px;
  margin:64px auto;
  padding:16px 42px;
  min-height:~"calc(100vh - 128px)";
  
  font-size:1.2rem;
  line-height:1.8rem;
  text-align:justify;
}

p {
  margin-bottom:.75rem;
}

h1, h2, h3, h4 {
  font-weight:300;
}

pre {
  overflow-y:hidden;
  white-space:pre-wrap;
  tab-size:4;
  margin:8px 0;
  padding: 16px;
  background:rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.24);
  border-radius: 3px;
}
input#textp {
  background: rgba(0,0,0,0.07);
  padding: 0 8px;
  width: ~"calc(100% - 16px)";
}

ul, ul li {
  list-style: decimal;
}

ul {
  padding-left:4rem;
}

p.small {
  font-size: .8em;
  padding-bottom: 1em;
}
              
            
!

JS

              
                const regex = /;[\s]?([0-9]*)$/g,
      defRows = 10,
      dateForm = "ddd DD.MM.YY - HH:mm",
      limit = 40;

$(() => {
  function displayShed(sched, next = 10) {
    if (+next < 2 || next.length == 0) next = 10;
    
    next = +next > limit ? limit : +next;
    
    let res = later.schedule(sched).next(next),
        con = $('ul.date-list');
    
    con.empty();
    $('.n-runs').text("" + next);
    
    _.each(res, (date) => {
      con.append(`<li>${moment(date).format(dateForm)}</li>`);
    })
    
    
  }
  
  $('#textp').on('input', function (e) {
    let val = this.value,
        len = regex.exec(val),
        txt = val.replace(regex, "");
    
    len = len ? len[1] : 10;
    
    let sched = later.parse.text(txt);
    
    displayShed(sched, len);
  }).trigger("input");
  
  
})
              
            
!
999px

Console