Thank you. It helped a lot and now its working great.

Note that the date format used in *exhibit* timeline was
not iso8601, but 'yyyy-mm-dd' style.
Thus the final working code was as following.
---
Natsuhiko Mizutani


<script>
    var months = {
             "jan": "01", "feb": "02", "mar": "03", "apr": "04", "may": 
"05", "jun": "06", "jul": "07", "aug": "08", "sep": "09", "oct": "10", 
"nov": "11", "dec": "12",
             "january": "01", "february": "02", "march": "03", "april": 
"04", "june": "06", "july": "07", "august": "08", "september": "09", 
"october": "10", "november": "11", "december": "12",
         };
         Exhibit.Functions["bibtex-date"] = {
             f: function(args) {
                 var results = new Exhibit.Set();
                 args[0].forEachValue(function(year) {
                     if (args[1].size == 0) {
                         try {
                             var d = year;
                             if (d != null) results.add(d);
                         } catch (e) {}
                     } else {
                         args[1].forEachValue(function(month) {
                             month = month.toLowerCase();
                             if (month in months) {
                                 try {
                                     var d = year + "-" + months[month] 
+ "-01";
                                     if (d != null) results.add(d);
                                 } catch (e) {}
                             }
                         });
                     }
                 });
                 return new Exhibit.Expression._Collection(results, "date");
             }
         };
</script>


_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to