comparison src/c/urweb.c @ 2217:98b87d905601

Merge.
author Ziv Scully <ziv@mit.edu>
date Mon, 10 Nov 2014 22:07:51 -0500
parents ef766ef6e242 d77b0665ba7c
children 794017f378de
comparison
equal deleted inserted replaced
2216:70ec9bb337be 2217:98b87d905601
2908 *dot = '.'; 2908 *dot = '.';
2909 return NULL; 2909 return NULL;
2910 } 2910 }
2911 } 2911 }
2912 else { 2912 else {
2913 if (strptime(s, TIME_FMT_PG, &stm) == end) { 2913 if (strptime(s, ctx->app->time_format, &stm) == end) {
2914 uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time)); 2914 uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time));
2915 r->seconds = mktime(&stm); 2915 r->seconds = mktime(&stm);
2916 r->microseconds = 0; 2916 r->microseconds = 0;
2917 return r; 2917 return r;
2918 } 2918 } else if (strptime(s, TIME_FMT_PG, &stm) == end) {
2919 else if (strptime(s, TIME_FMT, &stm) == end) { 2919 uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time));
2920 r->seconds = mktime(&stm);
2921 r->microseconds = 0;
2922 return r;
2923 } else if (strptime(s, TIME_FMT, &stm) == end) {
2920 uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time)); 2924 uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time));
2921 r->seconds = mktime(&stm); 2925 r->seconds = mktime(&stm);
2922 r->microseconds = 0; 2926 r->microseconds = 0;
2923 return r; 2927 return r;
2924 } else if (strptime(s, TIME_FMT_JS, &stm) == end) { 2928 } else if (strptime(s, TIME_FMT_JS, &stm) == end) {
3058 *dot = '.'; 3062 *dot = '.';
3059 uw_error(ctx, FATAL, "Can't parse time: %s", uw_Basis_htmlifyString(ctx, s)); 3063 uw_error(ctx, FATAL, "Can't parse time: %s", uw_Basis_htmlifyString(ctx, s));
3060 } 3064 }
3061 } 3065 }
3062 else { 3066 else {
3063 if (strptime(s, TIME_FMT_PG, &stm) == end) { 3067 if (strptime(s, ctx->app->time_format, &stm) == end) {
3068 uw_Basis_time r = { mktime(&stm) };
3069 return r;
3070 } else if (strptime(s, TIME_FMT_PG, &stm) == end) {
3064 uw_Basis_time r = { mktime(&stm) }; 3071 uw_Basis_time r = { mktime(&stm) };
3065 return r; 3072 return r;
3066 } else if (strptime(s, TIME_FMT, &stm) == end) { 3073 } else if (strptime(s, TIME_FMT, &stm) == end) {
3067 uw_Basis_time r = { mktime(&stm) }; 3074 uw_Basis_time r = { mktime(&stm) };
3068 return r; 3075 return r;